app/models/concerns/assignable_properties.rb
# Returns an array of attributes that are assignable in the CMS. This is a bit of an experiment as previously I put
# it in the CMS controllers, but that made for some interesting issues with concerns + deep-assignment.
# This might possibly be nicer, who knows?
Returns an array of attributes that are assignable in the CMS. This is a bit of an experiment as previously I put
it in the CMS controllers, but that made for some interesting issues with concerns + deep-assignment.
Returns an array of attributes that are assignable in the CMS . This is a bit of an experiment as previously I put it in the CMS controllers but that made for some interesting issues with concerns + deep - assignment .
def cms_assignable_attributes
      assignable = self.column_names.reject{ |f| f == self.primary_key }.map( &:to_sym )
      self.reflect_on_all_associations( :has_and_belongs_to_many ).each{|a| assignable << { "#{a.association_foreign_key.pluralize}": [] }}
      assignable = assignable.concat( @extra_cms_attrs ) unless defined?( @extra_cms_attrs ).nil?
      assignable
    end
def cms_assignable_attributes assignable = self . column_names . reject { | f | f == self . primary_key } . map ( & :to_sym ) self . reflect_on_all_associations ( :has_and_belongs_to_many ) . each { | a | assignable << { "#{a.association_foreign_key.pluralize}" : [ ] } } assignable = assignable . concat ( @extra_cms_attrs ) unless defined? ( @extra_cms_attrs ) . nil? assignable end
Returns an array of attributes that are assignable in the CMS.
Returns an array of attributes that are assignable in the CMS .
# get the available columns on this model but without the PK (as this shouldn’t be assigned) # also, get the other half HABTM relationships # dump in anything else + return