Module: Devise::Orm::CouchPotato::Schema
- Includes:
- Schema
- Defined in:
- lib/devise/orm/couch_potato/schema.rb
Instance Method Summary collapse
-
#apply_devise_schema(name, type, options = {}) ⇒ Object
Tell how to apply schema methods.
- #find(*args) ⇒ Object
- #find_for_authentication(conditions) ⇒ Object
Instance Method Details
#apply_devise_schema(name, type, options = {}) ⇒ Object
Tell how to apply schema methods.
7 8 9 10 11 12 13 14 |
# File 'lib/devise/orm/couch_potato/schema.rb', line 7 def apply_devise_schema(name, type, ={}) return unless Devise.apply_schema if [Date, DateTime].include?(type) property name, .merge({ :type => Time }) else property name, end end |
#find(*args) ⇒ Object
20 21 22 23 24 |
# File 'lib/devise/orm/couch_potato/schema.rb', line 20 def find(*args) = args. raise "You can't search with more than one condition yet =(" if [:conditions].keys.size > 1 find_by_key_and_value([:conditions].keys.first, [:conditions].values.first) end |
#find_for_authentication(conditions) ⇒ Object
16 17 18 |
# File 'lib/devise/orm/couch_potato/schema.rb', line 16 def find_for_authentication(conditions) find(:conditions => conditions) end |