Created
June 10, 2014 21:37
-
-
Save parndt/3207577ecedaea547605 to your computer and use it in GitHub Desktop.
Every. Time.
This file contains hidden or 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
DEPRECATION WARNING: The following options in your Gallery.has_many :gallery_images declaration are deprecated: :order. Please use a scope block instead. For example, the following: | |
has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment' | |
should be rewritten as the following: | |
has_many :spam_comments, -> { where spam: true }, class_name: 'Comment' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
People also forget when defining scopes in the first place to use lambdas. I've seen this about eight gajillion times:
Cue homophone replacement-level rage.