Module: ActsAsStaticRecord::InstanceMethods

Defined in:
lib/acts_as_static_record.rb

Instance Method Summary collapse

Instance Method Details

#static_record_lookup_keyObject

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 => <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