Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/acts_as_api/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def acts_as_api? #:nodoc:
# *Note*: There is only whitelisting for api accessible attributes.
# So once the model acts as api, you have to determine all attributes here that should
# be contained in the api responses.
def api_accessible(api_template, options = {}, &block)
def api_accessible(api_template, options = {})
attributes = api_accessible_attributes(api_template).try(:dup) || ApiTemplate.new(api_template)
attributes.merge!(api_accessible_attributes(options[:extend])) if options[:extend]

if block_given?
yield attributes
Proc.new.call attributes
end

class_attribute "api_accessible_#{api_template}".to_sym
Expand Down