Sha256: af3577f7e9f848f78df73c0ea99d41670816e277df0c562595e95db8f11dcf6c

Contents?: true

Size: 428 Bytes

Versions: 1

Compression:

Stored size: 428 Bytes

Contents

class SomeOtherModel < ActiveRecord::Base
  belongs_to :parent
  belongs_to :second_parent
  def parent_name
    parent.name if parent
  end
  def parent_name=(name)
    self.parent = Parent.find_by_name(name)
  end
  def second_parent_other_field
    second_parent.other_field if second_parent
  end
  def second_parent_other_field=(other_field)
    self.second_parent = SecondParent.find_by_other_field(other_field)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
view_mapper-0.3.3 test/views/belongs_to_auto_complete/expected_templates/some_other_model.rb