Class: Ecm::UserArea::User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ecm::UserArea::User
- Defined in:
- app/models/ecm/user_area/user.rb
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ Object
def self.current_id Thread.current end.
- #authenticable? ⇒ Boolean
- #human ⇒ Object
Instance Method Details
#as_json(options = {}) ⇒ Object
def self.current_id
Thread.current[:user_id]
end
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/models/ecm/user_area/user.rb', line 18 def as_json( = {}) .reverse_merge!(style: :default) style = .delete(:style) case style when :autocomplete { value: id, title: human, subtitle: self.inspect } else super end end |
#authenticable? ⇒ Boolean
31 32 33 |
# File 'app/models/ecm/user_area/user.rb', line 31 def authenticable? [active, confirmed, approved].all? end |
#human ⇒ Object
35 36 37 |
# File 'app/models/ecm/user_area/user.rb', line 35 def human email end |