module ScoobySnacks::WorkFormBehavior

Public Class Methods

build_permitted_params() click to toggle source
Calls superclass method
# File lib/scooby_snacks/work_form_behavior.rb, line 26
def self.build_permitted_params
  permitted = super
  ScoobySnacks::METADATA_SCHEMA.controlled_field_names.each do |field_name|
    permitted << {"#{field_name}_attributes".to_sym => [:id, :_destroy]}
  end
  return permitted
end

Public Instance Methods

primary_terms() click to toggle source
# File lib/scooby_snacks/work_form_behavior.rb, line 18
def primary_terms 
  @primary_terms ||=  (schema.primary_display_field_names + schema.editor_primary_display_field_names).uniq.map{|name| name.to_sym}
end
schema() click to toggle source
# File lib/scooby_snacks/work_form_behavior.rb, line 14
def schema
  ScoobySnacks::METADATA_SCHEMA
end
secondary_terms() click to toggle source
# File lib/scooby_snacks/work_form_behavior.rb, line 22
def secondary_terms 
  @secondary_terms ||=  (schema.all_field_names - schema.primary_display_field_names - schema.editor_primary_display_field_names).map{|name| name.to_sym}
end