Method: Lore::Attribute_Settings#explicit
- Defined in:
- lib/lore/model/attribute_settings.rb
#explicit ⇒ Object
All attributes that aren’t implicit and thus can be set manually.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/lore/model/attribute_settings.rb', line 118 def explicit return @explicit if @explicit @explicit = {} @fields.each_pair { |table, attrib_list| @explicit[table] = attrib_list.reject { |a| # @fields includes all inherited fields. # We do not want to aggregated models to # extend @expected and @implicit, as they # can only be referenced by their primary # keys, but never assigned values in e.g. # Model.create. !@implicit[table] || @implicit[table].include?(a.to_sym) } } @explicit.delete_if { |table, fields| fields.length == 0 } @explicit end |