Sha256: d0f3cf4b74491472b3fb4f7298c41e8ffcc7c830ffcaf135bc9aeb12ceeba126
Contents?: true
Size: 407 Bytes
Versions: 10
Compression:
Stored size: 407 Bytes
Contents
class Widget < ActiveRecord::Base has_paper_trail has_one :wotsit has_many :whatchamajiggers, as: :owner EXCLUDED_NAME = "Biglet".freeze validates :name, exclusion: { in: [EXCLUDED_NAME] } # `has_many` syntax for specifying order uses a lambda in Rails 4 if ::ActiveRecord::VERSION::MAJOR >= 4 has_many :fluxors, -> { order(:name) } else has_many :fluxors, order: :name end end
Version data entries
10 entries across 10 versions & 2 rubygems