class Pma < ActiveRecord::Base
attr_accessible :name, :status
belongs_to :division
belongs_to :dealer
has_many :pma_maps
has_many :pma_locations, :through => :pma_maps
def to_label
name
end
end
class PmaMap < ActiveRecord::Base
attr_accessible :pma_location_id, :pma_id
belongs_to :pma_location
belongs_to :pma
def to_label
"location: #{pma_location_id}, Pma:#{pma_id}"
end
end
class PmaLocation < ActiveRecord::Base
attr_accessible :post_code, :suburb
has_many :pma_maps
has_one :pma, :through => :pma_maps
def to_label
"#{suburb} #{post_code}"
end
end
> --
> You received this message because you are subscribed to the Google Groups
> "ActiveScaffold : Ruby on Rails plugin" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/activescaffold/-/IOmMEHjsTgUJ.
> To post to this group, send email to
actives...@googlegroups.com.
> To unsubscribe from this group, send email to
>
activescaffol...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/activescaffold?hl=en.