databound 3.1.1 → 3.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83275ef550b6aae9457802bf4ce2f153673c2daa
4
- data.tar.gz: 72e59a6d109af6c81be354c7b3b05cd99bb4e3ed
3
+ metadata.gz: 045bfebd7dbcfd1235c613b720a00734ea7f7db6
4
+ data.tar.gz: 82a32802692b1a40059cd541e3c80d217394de67
5
5
  SHA512:
6
- metadata.gz: ab72b42dd6f209f67a7da51f2a93870f3486eae229dd707336205a9c3915883f216c93ef91d7e5ada8ceeb11c8adbe3ba724d98ded9b3366777f981313776fad
7
- data.tar.gz: 1843e0a8a2428bcfa4ab92ff3edb10927ee7206e913f4ba23db661405844767946e63592baa7630b70736e42f3a8e16dc1dc17a19c7d0e1d14318ea2fda1334a
6
+ metadata.gz: 37887b99be8b2b5fb91d4248bdabacad1ab0b6053c0967fd54bfdd9c35e7411a49c5ff701bb47e86fe879811df1e7f461f3d93da06d87bea180138c3ff29ddd9
7
+ data.tar.gz: 373c67bbfb09bcb578281cbe5c2bff7de53c2e6de57d6d501726f3fd6e4a7cc32d7dd3f850d67d1ee64e7f27f9c69c8cad3427b55b85dc97f90c60edcda541fc
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  [![Gem](https://img.shields.io/gem/v/databound.svg?style=flat-square)](https://rubygems.org/gems/databound)
2
2
  [![Bower](https://img.shields.io/bower/v/databound.svg?style=flat-square)](http://bower.io/search/?q=databound)
3
3
  [![npm](https://img.shields.io/npm/v/databound.svg?style=flat-square)](https://www.npmjs.com/package/databound)
4
- [![Code Climate](http://img.shields.io/codeclimate/github/Nedomas/databound-rails.svg?style=flat-square)](https://codeclimate.com/github/Nedomas/databound)
5
- [![Build Status](http://img.shields.io/travis/Nedomas/databound-rails.svg?style=flat-square)](https://travis-ci.org/Nedomas/databound)
4
+ [![Code Climate](http://img.shields.io/codeclimate/github/Nedomas/databound-rails.svg?style=flat-square)](https://codeclimate.com/github/Nedomas/databound-rails)
5
+ [![Build Status](http://img.shields.io/travis/Nedomas/databound-rails.svg?style=flat-square)](https://travis-ci.org/Nedomas/databound-rails)
6
6
 
7
7
  ![Databound](https://cloud.githubusercontent.com/assets/1877286/4743542/df89dcec-5a28-11e4-9114-6f383fe269cb.png)
8
8
 
@@ -67,7 +67,18 @@ module Databound
67
67
  model.where(scope.to_h).where_values.reduce(:and)
68
68
  end
69
69
 
70
- nodes.reduce(:or)
70
+ left_query = nodes.reduce(:or)
71
+ return unless left_query
72
+
73
+ [left_query.to_sql, *bound_values(scopes)]
74
+ end
75
+
76
+ def bound_values(scopes)
77
+ values = scopes.flat_map do |scope|
78
+ model.where(scope.to_h).bind_values
79
+ end
80
+
81
+ values.map(&:last)
71
82
  end
72
83
 
73
84
  def check_params!(action)
@@ -124,7 +135,7 @@ module Databound
124
135
  end
125
136
 
126
137
  def mongoid?
127
- defined?(Moigoid) and model.ancestors.include?(Mongoid::Document)
138
+ defined?(Mongoid) and model.ancestors.include?(Mongoid::Document)
128
139
  end
129
140
 
130
141
  def activerecord?
@@ -1,3 +1,3 @@
1
1
  module Databound
2
- VERSION = '3.1.1'
2
+ VERSION = '3.1.2'
3
3
  end
@@ -13,7 +13,7 @@ describe PermitController, type: :controller do
13
13
  data = {
14
14
  data: {
15
15
  city: 'LA',
16
- dont_permit: true,
16
+ dont_permit: 'true',
17
17
  },
18
18
  scope: {},
19
19
  }
@@ -14,6 +14,7 @@ ActiveRecord::Schema.define do
14
14
  create_table(:projects, force: true) do |t|
15
15
  t.string :city
16
16
  t.integer :user_id
17
+ t.boolean :dont_permit
17
18
  t.timestamps
18
19
  end
19
20
 
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
 
4
4
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
- gem 'rails', '4.1.6'
5
+ gem 'rails', '4.2'
6
6
  # Use sqlite3 as the database for Active Record
7
7
  gem 'sqlite3'
8
8
  # Use SCSS for stylesheets
@@ -37,4 +37,3 @@ gem 'spring', group: :development
37
37
 
38
38
  # Use debugger
39
39
  # gem 'debugger', group: [:development, :test]
40
-
@@ -1,106 +1,131 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- actionmailer (4.1.6)
5
- actionpack (= 4.1.6)
6
- actionview (= 4.1.6)
4
+ actionmailer (4.2.0)
5
+ actionpack (= 4.2.0)
6
+ actionview (= 4.2.0)
7
+ activejob (= 4.2.0)
7
8
  mail (~> 2.5, >= 2.5.4)
8
- actionpack (4.1.6)
9
- actionview (= 4.1.6)
10
- activesupport (= 4.1.6)
11
- rack (~> 1.5.2)
9
+ rails-dom-testing (~> 1.0, >= 1.0.5)
10
+ actionpack (4.2.0)
11
+ actionview (= 4.2.0)
12
+ activesupport (= 4.2.0)
13
+ rack (~> 1.6.0)
12
14
  rack-test (~> 0.6.2)
13
- actionview (4.1.6)
14
- activesupport (= 4.1.6)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
17
+ actionview (4.2.0)
18
+ activesupport (= 4.2.0)
15
19
  builder (~> 3.1)
16
20
  erubis (~> 2.7.0)
17
- activemodel (4.1.6)
18
- activesupport (= 4.1.6)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
23
+ activejob (4.2.0)
24
+ activesupport (= 4.2.0)
25
+ globalid (>= 0.3.0)
26
+ activemodel (4.2.0)
27
+ activesupport (= 4.2.0)
19
28
  builder (~> 3.1)
20
- activerecord (4.1.6)
21
- activemodel (= 4.1.6)
22
- activesupport (= 4.1.6)
23
- arel (~> 5.0.0)
24
- activesupport (4.1.6)
25
- i18n (~> 0.6, >= 0.6.9)
29
+ activerecord (4.2.0)
30
+ activemodel (= 4.2.0)
31
+ activesupport (= 4.2.0)
32
+ arel (~> 6.0)
33
+ activesupport (4.2.0)
34
+ i18n (~> 0.7)
26
35
  json (~> 1.7, >= 1.7.7)
27
36
  minitest (~> 5.1)
28
- thread_safe (~> 0.1)
37
+ thread_safe (~> 0.3, >= 0.3.4)
29
38
  tzinfo (~> 1.1)
30
- arel (5.0.1.20140414130214)
39
+ arel (6.0.0)
31
40
  builder (3.2.2)
32
41
  coffee-rails (4.0.1)
33
42
  coffee-script (>= 2.2.0)
34
43
  railties (>= 4.0.0, < 5.0)
35
- coffee-script (2.3.0)
44
+ coffee-script (2.4.1)
36
45
  coffee-script-source
37
46
  execjs
38
- coffee-script-source (1.8.0)
47
+ coffee-script-source (1.9.1)
39
48
  erubis (2.7.0)
40
- execjs (2.2.2)
49
+ execjs (2.5.2)
50
+ globalid (0.3.5)
51
+ activesupport (>= 4.1.0)
41
52
  hike (1.2.3)
42
- i18n (0.6.11)
43
- jbuilder (2.2.2)
53
+ i18n (0.7.0)
54
+ jbuilder (2.2.12)
44
55
  activesupport (>= 3.0.0, < 5)
45
56
  multi_json (~> 1.2)
46
- jquery-rails (3.1.2)
47
- railties (>= 3.0, < 5.0)
57
+ jquery-rails (4.0.3)
58
+ rails-dom-testing (~> 1.0)
59
+ railties (>= 4.2.0)
48
60
  thor (>= 0.14, < 2.0)
49
- json (1.8.1)
50
- mail (2.6.1)
61
+ json (1.8.2)
62
+ loofah (2.0.1)
63
+ nokogiri (>= 1.5.9)
64
+ mail (2.6.3)
51
65
  mime-types (>= 1.16, < 3)
52
- mime-types (2.4.1)
53
- minitest (5.4.2)
54
- multi_json (1.10.1)
55
- rack (1.5.2)
56
- rack-test (0.6.2)
66
+ mime-types (2.4.3)
67
+ mini_portile (0.6.2)
68
+ minitest (5.5.1)
69
+ multi_json (1.11.0)
70
+ nokogiri (1.6.6.2)
71
+ mini_portile (~> 0.6.0)
72
+ rack (1.6.0)
73
+ rack-test (0.6.3)
57
74
  rack (>= 1.0)
58
- rails (4.1.6)
59
- actionmailer (= 4.1.6)
60
- actionpack (= 4.1.6)
61
- actionview (= 4.1.6)
62
- activemodel (= 4.1.6)
63
- activerecord (= 4.1.6)
64
- activesupport (= 4.1.6)
75
+ rails (4.2.0)
76
+ actionmailer (= 4.2.0)
77
+ actionpack (= 4.2.0)
78
+ actionview (= 4.2.0)
79
+ activejob (= 4.2.0)
80
+ activemodel (= 4.2.0)
81
+ activerecord (= 4.2.0)
82
+ activesupport (= 4.2.0)
65
83
  bundler (>= 1.3.0, < 2.0)
66
- railties (= 4.1.6)
67
- sprockets-rails (~> 2.0)
68
- railties (4.1.6)
69
- actionpack (= 4.1.6)
70
- activesupport (= 4.1.6)
84
+ railties (= 4.2.0)
85
+ sprockets-rails
86
+ rails-deprecated_sanitizer (1.0.3)
87
+ activesupport (>= 4.2.0.alpha)
88
+ rails-dom-testing (1.0.6)
89
+ activesupport (>= 4.2.0.beta, < 5.0)
90
+ nokogiri (~> 1.6.0)
91
+ rails-deprecated_sanitizer (>= 1.0.1)
92
+ rails-html-sanitizer (1.0.2)
93
+ loofah (~> 2.0)
94
+ railties (4.2.0)
95
+ actionpack (= 4.2.0)
96
+ activesupport (= 4.2.0)
71
97
  rake (>= 0.8.7)
72
98
  thor (>= 0.18.1, < 2.0)
73
- rake (10.3.2)
74
- rdoc (4.1.2)
75
- json (~> 1.4)
99
+ rake (10.4.2)
100
+ rdoc (4.2.0)
76
101
  sass (3.2.19)
77
- sass-rails (4.0.3)
102
+ sass-rails (4.0.5)
78
103
  railties (>= 4.0.0, < 5.0)
79
- sass (~> 3.2.0)
80
- sprockets (~> 2.8, <= 2.11.0)
104
+ sass (~> 3.2.2)
105
+ sprockets (~> 2.8, < 3.0)
81
106
  sprockets-rails (~> 2.0)
82
107
  sdoc (0.4.1)
83
108
  json (~> 1.7, >= 1.7.7)
84
109
  rdoc (~> 4.0)
85
- spring (1.1.3)
86
- sprockets (2.11.0)
110
+ spring (1.3.4)
111
+ sprockets (2.12.3)
87
112
  hike (~> 1.2)
88
113
  multi_json (~> 1.0)
89
114
  rack (~> 1.0)
90
115
  tilt (~> 1.1, != 1.3.0)
91
- sprockets-rails (2.2.0)
116
+ sprockets-rails (2.2.4)
92
117
  actionpack (>= 3.0)
93
118
  activesupport (>= 3.0)
94
119
  sprockets (>= 2.8, < 4.0)
95
- sqlite3 (1.3.9)
120
+ sqlite3 (1.3.10)
96
121
  thor (0.19.1)
97
- thread_safe (0.3.4)
122
+ thread_safe (0.3.5)
98
123
  tilt (1.4.1)
99
- turbolinks (2.4.0)
124
+ turbolinks (2.5.3)
100
125
  coffee-rails
101
126
  tzinfo (1.2.2)
102
127
  thread_safe (~> 0.1)
103
- uglifier (2.5.3)
128
+ uglifier (2.7.1)
104
129
  execjs (>= 0.3.0)
105
130
  json (>= 1.8.0)
106
131
 
@@ -111,7 +136,7 @@ DEPENDENCIES
111
136
  coffee-rails (~> 4.0.0)
112
137
  jbuilder (~> 2.0)
113
138
  jquery-rails
114
- rails (= 4.1.6)
139
+ rails (= 4.2)
115
140
  sass-rails (~> 4.0.3)
116
141
  sdoc (~> 0.4.0)
117
142
  spring
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: databound
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domas Bitvinskas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-10 00:00:00.000000000 Z
11
+ date: 2015-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  requirements: []
248
248
  rubyforge_project:
249
- rubygems_version: 2.2.2
249
+ rubygems_version: 2.4.5
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: Provides Javascript a simple API to the Ruby on Rails CRUD