Class: Amalgam::Authorities::Models::ActiveRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Amalgam::Authorities::Models::ActiveRecord
- Includes:
- Amalgam::Authorities::Model
- Defined in:
- lib/amalgam/authorities/models/active_record.rb
Instance Attribute Summary collapse
-
#current_password ⇒ Object
Returns the value of attribute current_password.
-
#login ⇒ Object
Returns the value of attribute login.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Amalgam::Authorities::Model
Instance Attribute Details
#current_password ⇒ Object
Returns the value of attribute current_password.
10 11 12 |
# File 'lib/amalgam/authorities/models/active_record.rb', line 10 def current_password @current_password end |
#login ⇒ Object
Returns the value of attribute login.
10 11 12 |
# File 'lib/amalgam/authorities/models/active_record.rb', line 10 def login @login end |
Class Method Details
.locate(content) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/amalgam/authorities/models/active_record.rb', line 21 def self.locate(content) query = [] Amalgam..each do |key| query << "#{key.to_s} = :value" end where([query.join(" OR "),{:value => content}]).first end |
Instance Method Details
#admin? ⇒ Boolean
17 18 19 |
# File 'lib/amalgam/authorities/models/active_record.rb', line 17 def admin? Amalgam.[self.class.model_name.underscore.to_sym] == :admin end |