Sha256: 856827d2966ab2933da5e20a772dba16539ceadd06db0bc9ab1757a1e6f1d676

Contents?: true

Size: 428 Bytes

Versions: 5

Compression:

Stored size: 428 Bytes

Contents

class Person < ActiveRecord::Base
  
  has_custom_field_behavior :class_name => 'Preference', 
                   :name_field => :key
                   
  has_custom_field_behavior :class_name => 'PersonContactInfo', 
                   :foreign_key => :contact_id, 
                   :fields => %w(phone aim icq)

  def custom_field_attributes(model)
    model == Preference ? %w(project_search project_order) : nil
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
has_custom_fields-0.0.5 spec/fixtures/person.rb
has_custom_fields-0.0.4 spec/fixtures/person.rb
has_custom_fields-0.0.3 spec/fixtures/person.rb
has_custom_fields-0.0.2 spec/fixtures/person.rb
has_custom_fields-0.0.1 spec/fixtures/person.rb