We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class Country < ApplicationRecord include ChronoModel::TimeMachine has_many :cities, dependent: :destroy has_many :schools, through: :cities end class City < ApplicationRecord include ChronoModel::TimeMachine validates :name, presence: true belongs_to :country end class School < ApplicationRecord include ChronoModel::TimeMachine belongs_to :city has_one :country, through: :city end
Country.destroy_all italy = Country.create!(name: 'Italy') rome = italy.cities.create!(name: 'Rome') galilei = rome.schools.create!(name: 'G. Galilei') ts = Time.now sleep 1 buonarroti = rome.schools.create!(name: 'M. Buonarroti') Country.as_of(ts).includes(:schools).first.cities.last.schools.map(&:name).sort == [galilei.name]
["G. Galilei"]
["G. Galilei", "M. Buonarroti"]
The text was updated successfully, but these errors were encountered:
Fix issue with through associations
4838dfc
Fix #163
59b14a4
2f8cd33
74a2586
Successfully merging a pull request may close this issue.
Models
Test
Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: