forked from metaskills/grouped_scope
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50f03a2
commit 548c82e
Showing
16 changed files
with
351 additions
and
228 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
require 'active_record/version' | ||
require 'grouped_scope/errors' | ||
require 'grouped_scope/grouping' | ||
require 'grouped_scope/self_grouping' | ||
|
||
require 'grouped_scope/arish/associations/association_scope' | ||
require 'grouped_scope/arish/reflection' | ||
require 'grouped_scope/arish/associations/collection_association' | ||
require 'grouped_scope/arish/associations/builder/grouped_collection_association' | ||
require 'grouped_scope/arish/associations/association_scope' | ||
require 'grouped_scope/arish/relation/predicate_builer' | ||
require 'grouped_scope/arish/base' | ||
|
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module GroupedScope | ||
module Arish | ||
module PredicateBuilder | ||
|
||
extend ActiveSupport::Concern | ||
|
||
included do | ||
singleton_class.alias_method_chain :build_from_hash, :grouped_scope | ||
end | ||
|
||
module ClassMethods | ||
|
||
def build_from_hash_with_grouped_scope(engine, attributes, default_table) | ||
attributes.select{ |k,v| GroupedScope::SelfGroupping === v }.each do |kv| | ||
k, v = kv | ||
attributes[k] = v.ids | ||
end | ||
build_from_hash_without_grouped_scope(engine, attributes, default_table) | ||
end | ||
|
||
end | ||
|
||
end | ||
end | ||
end | ||
|
||
ActiveRecord::PredicateBuilder.send :include, GroupedScope::Arish::PredicateBuilder |
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
Oops, something went wrong.