end
instead to call
self.merchant_category.active
Thanks,
Tod
Tod Tod wrote:
> Hi and thanks,
>
> yes this works Shop.find(2).shop_categories.find_by_category_id(10)
>
> In shop_categories table I have field 'active' to mark that a category
> is visible/active f
> I know that this is not so good solution, but I could not figured out
> over way to get this value. It is realy over kill for server. And It
> would get harder if there are more values that I need to keep in
> merchant_categories.
oops, should be shop_categories
Tod
ps. hmm, here posts do
not figured out
over way to get this value. It is realy over kill for server. And It
would get harder if there are more values that I need to keep in
merchant_categories.
Is there a better way to do it?
Tod
Frederick Cheung wrote:
> On Mar 7, 6:08�pm, Tod Tod wrote:
>> am
ay of living this kind of chainging. But I is
it is not.
I'm just guessing but I think this kind of behaviour is in DataMapper,
am I right?
Tod
Frederick Cheung wrote:
> On Mar 7, 4:39�pm, Tod Tod wrote:
>>
>> Logically this kind of chaining
>> Shop.find(2).ca
Hi rainer54
Actually
Shop.find(1).categories.find(10) and
Shop.find(1).categories.find(:first, :conditions => 'category_id = 10')
are the different ways to retrieve same category record in association
with shop 1.
But going further with association I need to retrieve records from
shop_catego
Hi
I have a standard associations belongs_to, has_many :through
class Shop < ActiveRecord::Base
has_many :show_categories
has_many :categories, :through => :shop_categories
end
class Category < ActiveRecord::Base
has_many :shop_categories
has_many :shops, :through => :shop_categories
6 matches
Mail list logo