Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove custom "distinct" scope, since it's provided by Rails, and Rai…
…ls 4.1 forbids that name The "distinct" method is available since Rails 4.0.0 [1] (and was available as "uniq" since Rails 3.2.0 [2]), so we no longer need to define our own "distinct" scope. And as of Rails 4.1 it is forbidden to define a scope with a conflicting name[3], so we have to remove our "distinct" scope. [1] rails/rails@a1bb6c8 [2] rails/rails@562583c [3] rails/rails#13450 Co-authored-by: Tom Levy <tomlevy93@gmail.com>
- Loading branch information
1 parent
48fc1a5
commit b911b8d
Showing
8 changed files
with
0 additions
and
20 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
class Role < ActiveRecord::Base | ||
|
||
has_and_belongs_to_many :users | ||
|
||
validates :name, :presence => true | ||
|
||
scope :distinct, -> { select("distinct(roles.id), roles.*") } | ||
|
||
end |
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
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
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