sprsquish-conditions_fu 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/init.rb +18 -0
  3. metadata +2 -1
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 0
4
+ :patch: 1
data/init.rb ADDED
@@ -0,0 +1,18 @@
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
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprsquish-conditions_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi
@@ -23,6 +23,7 @@ extensions: []
23
23
  extra_rdoc_files: []
24
24
 
25
25
  files:
26
+ - init.rb
26
27
  - TODO.txt
27
28
  - VERSION.yml
28
29
  - lib/conditions_fu.rb