Skip to content

Commit

Permalink
performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Aug 22, 2017
1 parent 648ca55 commit fd32277
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit fd32277

Please sign in to comment.