Sha256: 557bc68d4e0621e489269409d841aa08fd86559f2ab41a315294235d8ecb3228
Contents?: true
Size: 564 Bytes
Versions: 62
Compression:
Stored size: 564 Bytes
Contents
ActiveRecord::Base.class_eval do def self.fields(include_in_migration = true, &b) # Any model that calls 'fields' gets a bunch of other # functionality included automatically, but make sure we only # include it once include HoboFields::Model unless HoboFields::Model.in?(included_modules) @include_in_migration ||= include_in_migration if b dsl = HoboFields::FieldDeclarationDsl.new(self) if b.arity == 1 yield dsl else dsl.instance_eval(&b) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems