Module: Devise::Activeresource::Base::ClassMethods
- Defined in:
- lib/devise/activeresource/base.rb
Instance Method Summary collapse
Instance Method Details
#increment_counter(counter_name, id) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/devise/activeresource/base.rb', line 9 def increment_counter(counter_name, id) element = find(id) return false if element.nil? value = element.send(counter_name) element.send("#{counter_name}=", value + 1) element.save end |
#to_adapter ⇒ Object
5 6 7 |
# File 'lib/devise/activeresource/base.rb', line 5 def to_adapter @to_adapter ||= Devise::Activeresource::Adapter.new(self) end |