Skip to content
New issue

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

Problem with Has Many Through Association Rails #530

Closed
neeraj-joshi01 opened this issue Apr 28, 2015 · 1 comment
Closed

Problem with Has Many Through Association Rails #530

neeraj-joshi01 opened this issue Apr 28, 2015 · 1 comment

Comments

@neeraj-joshi01
Copy link

class Document < ActiveRecord::Base
  has_many :sections
  has_many :paragraphs, through: :sections
end
 
class Section < ActiveRecord::Base
  belongs_to :document
  has_many :paragraphs
end
 
class Paragraph < ActiveRecord::Base
  belongs_to :section
end

Paper_Trail 4.0.0 Beta doesn't cater this situation. It looks for foreign key of association Paragraph i.e, section_id in the through model i.e, Section which will not be available in the above mentioned case.

@batter
Copy link
Collaborator

batter commented Apr 29, 2015

Please see #466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants