Module: Card::Set::All::FetchHelper::ClassMethods

Defined in:
card/tmpsets/set/mod002-core/all/fetch_helper.rb

Instance Method Summary collapse

Instance Method Details

#controller_fetch(args) ⇒ Object

a fetch method to support the needs of the card controller. should be in Decko?



11
12
13
14
15
16
17
18
19
20
21
# File 'card/tmpsets/set/mod002-core/all/fetch_helper.rb', line 11

def controller_fetch args
  card_opts = controller_fetch_opts args
  if args[:action] == "create"
    # FIXME: we currently need a "new" card to catch duplicates
    # (otherwise save will just act like a normal update)
    # We may need a "#create" instance method to handle this checking?
    Card.new card_opts
  else
    standard_controller_fetch args, card_opts
  end
end