sprsquish-conditions_fu 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +2 -2
- data/init.rb +0 -17
- data/lib/conditions_fu.rb +17 -0
- metadata +1 -1
data/VERSION.yml
CHANGED
data/init.rb
CHANGED
@@ -1,18 +1 @@
|
|
1
1
|
require 'conditions_fu'
|
2
|
-
require 'activerecord'
|
3
|
-
|
4
|
-
Symbol.send(:include, ConditionsFu::SymbolQueryExtensions)
|
5
|
-
|
6
|
-
# extend activerecord with the condition methods
|
7
|
-
ActiveRecord::Base.send(:extend, ConditionsFu::Base)
|
8
|
-
|
9
|
-
# override sanitize_sql_hash_for_conditions
|
10
|
-
module ::ActiveRecord
|
11
|
-
class Base
|
12
|
-
class << self
|
13
|
-
# use the sanitize_sql_hash_for_conditions_with_attribute_queries
|
14
|
-
alias_method_chain :sanitize_sql_hash_for_conditions, :attribute_queries
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
data/lib/conditions_fu.rb
CHANGED
@@ -120,3 +120,20 @@ module ConditionsFu
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
end
|
123
|
+
|
124
|
+
require 'activerecord'
|
125
|
+
|
126
|
+
Symbol.send(:include, ConditionsFu::SymbolQueryExtensions)
|
127
|
+
|
128
|
+
# extend activerecord with the condition methods
|
129
|
+
ActiveRecord::Base.send(:extend, ConditionsFu::Base)
|
130
|
+
|
131
|
+
# override sanitize_sql_hash_for_conditions
|
132
|
+
module ::ActiveRecord
|
133
|
+
class Base
|
134
|
+
class << self
|
135
|
+
# use the sanitize_sql_hash_for_conditions_with_attribute_queries
|
136
|
+
alias_method_chain :sanitize_sql_hash_for_conditions, :attribute_queries
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|