Module: ActsAsStaticRecord::InstanceMethods
- Defined in:
- lib/acts_as_static_record.rb
Instance Method Summary collapse
-
#static_record_lookup_key ⇒ Object
returns the lookup key for this record For example if the defintion in
User
was acts_as_static_record :key => :user_name.
Instance Method Details
#static_record_lookup_key ⇒ Object
returns the lookup key for this record For example if the defintion in User
was
acts_as_static_record :key => :user_name
user.user_name
=> "Blythe Snow Giraffe"
user.static_record_lookup_key
=> 'blythe_snow_giraffe'
which could then be used to access the record like
User['snowgiraffe']
=> <User id: 15, user_name: "Blythe Snow Giraffe">
272 273 274 |
# File 'lib/acts_as_static_record.rb', line 272 def static_record_lookup_key self.class.static_record_lookup_key(self) end |