Так у вас сейчас есть что-то подобное?
class ingredient << ActiveRecord::Base
has_and_belongs_to_many :recipes
.....
end
class recipe << ActiveRecord::Base
has_and_belongs_to_many :ingredients
....
end
И вы хотите получить даты, которые они добавили. Это можно сделать с помощью модели соединения. (см. http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html) и много ко многим. особенно эта строка Choosing which way to build a many-to-many relationship is not always simple. If you need to work with the relationship model as its own entity, use has_many :through. Use has_and_belongs_to_many when working with legacy schemas or when you never work directly with the relationship itself.
Так что, если вы построите модель соединения, вы получите что-то вроде ниже.
class ingredient << ActiveRecord::Base
has_many :mixtures
has_many :recipes , :through=> :mixtures
.....
end
class recipe << ActiveRecord::Base
has_many :mixtures
has_many :ingredients, :through=> :mixtures
....
end
class mixture << ActiveRecord::Base
belongs_to :recipe
belongs_to :ingredient
...
end
Таким образом, вы можете добавлять атрибуты в таблицу смесей, чтобы вы могли узнать, когда они были добавлены, кто их добавил и т.д. ...