Created
July 28, 2016 16:50
-
-
Save steverob/19c7d58c7da6062adbed5d0fddd0ee1f to your computer and use it in GitHub Desktop.
Ambiguous field exception in AR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
has_many :bazs | |
has_many :bars, through: :bazs | |
end | |
class Baz | |
belongs_to :foo | |
has_many :bars | |
end | |
class Bar | |
default_scope -> { order('created_at DESC') } | |
belongs_to :baz | |
end | |
# | |
foo.bars.update_all attribute: 'new_value' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment