Sha256: 85e1e24177ab7a1dfc4ecae7d9021f2b58c20ee652e688c271bdad256898cc00
Contents?: true
Size: 468 Bytes
Versions: 11
Compression:
Stored size: 468 Bytes
Contents
if defined?(::ActiveRecord) class ActiveRecord::Base def self.rails_admin(&block) RailsAdmin::Config.model(self, &block) end def rails_admin_default_object_label_method self.new_record? ? "new #{self.class.to_s}" : "#{self.class.to_s} ##{self.id}" end def safe_send(value) if self.attributes.find{ |k,v| k.to_s == value.to_s } self.read_attribute(value) else self.send(value) end end end end
Version data entries
11 entries across 11 versions & 4 rubygems