activeadmin-mongoid 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6da33a191ec2b498b1c60af1f60f5a1532c83acca6bb9b6de27d5185bb174ca
4
- data.tar.gz: a06a98d29c14d147a96ffebd21c84ae34fe8cde13e9aec72c2cdf2acc8b49283
3
+ metadata.gz: 9525c1fd3bd558d51fd4c298764e85a33e4eda0542e41a5b22907b67d1063194
4
+ data.tar.gz: 18e3fbf3d3a5dcc93e32c4ddb6a6d6d12d14e403785b197622ad2ae5f13cac49
5
5
  SHA512:
6
- metadata.gz: 7f645440724c5a60a3a38eb184bac5af562bb17411251cfac0c55e5e0f57d643db030d69613090f9541ad5e767529599466bf8c23bd9310d9633839be48faed2
7
- data.tar.gz: cc2fb3f311e28347f84241d20c74d15761a4df5e672ce7eeb16912a88d23858eb13486f114fef6b0f28102dcaef2cb031b82cd4f3f3afb3bc3936bbe61919d18
6
+ metadata.gz: c768a4b1e7a4cf1153ca94c84a950214d6e25353842a385874280c75ca2b2d2e1be9d5439e73665631f7618cc15edb314c6be02d9a812007175d7c67a7637465
7
+ data.tar.gz: 37dc8c7023d59e97ef50d70b1896db131fafec039e697927d90d4e88eff56adcc5e069905bcd75252f4678cf30d3d30cb84814c3d42b0c0997916c1ddeb8f9e0
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  *.rbc
3
3
  .config
4
4
  .yardoc
5
- /Gemfile.lock
6
5
  InstalledFiles
7
6
  _yardoc
8
7
  coverage
data/.travis.yml CHANGED
@@ -1,8 +1,11 @@
1
1
  language: ruby
2
2
  services:
3
3
  - mongodb
4
+ before_install:
5
+ - gem update --system
6
+ - gem install bundler
4
7
  rvm:
5
- - 2.2
6
8
  - 2.3
7
9
  - 2.4
8
10
  - 2.5
11
+ - 2.6
data/Gemfile CHANGED
@@ -1,38 +1,20 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Declare your gem's dependencies in activeadmin-mongoid.gemspec.
4
- # Bundler will treat runtime dependencies like base dependencies, and
5
- # development dependencies will be added by default to the :development group.
6
3
  gemspec
7
4
 
8
- gem 'ransack', github: 'activerecord-hackery/ransack'
9
- gem 'ransack-mongoid', github: 'activerecord-hackery/ransack-mongoid'
5
+ gem 'ransack-mongoid', git: 'https://github.com/activerecord-hackery/ransack-mongoid'
10
6
 
11
- # Test app stuff
12
-
13
- gem 'rails', '~> 5.1'
14
- gem 'kaminari', '~> 1.0'
15
- gem 'kaminari-mongoid'
7
+ gem 'rails', '~> 5.2'
16
8
 
17
9
  gem 'devise'
18
10
 
19
- # Gems used only for assets and not required
20
- # in production environments by default.
21
- group :assets do
22
- gem 'sass-rails', '>= 5.0.6'
23
- gem 'coffee-rails', '~> 4.0'
24
-
25
- # See https://github.com/sstephenson/execjs#readme for more supported runtimes
26
- # gem 'therubyracer', :platforms => :ruby
27
- gem 'uglifier', '>= 1.0.3'
28
- end
11
+ gem 'pry-rails'
29
12
 
30
13
  gem 'jquery-rails'
31
14
  gem 'jquery-ui-rails'
32
15
  gem 'jslint'
33
16
 
34
17
  group :test do
35
- gem 'pry-rails'
36
18
  gem 'capybara'
37
19
  gem 'poltergeist'
38
20
  gem 'launchy'
@@ -1,79 +1,91 @@
1
+ GIT
2
+ remote: https://github.com/activerecord-hackery/ransack-mongoid
3
+ revision: bd1935293d2f285fa7cf33d2c5c90d981bf67338
4
+ specs:
5
+ ransack-mongoid (0.1.0)
6
+
1
7
  PATH
2
- remote: ..
8
+ remote: .
3
9
  specs:
4
- activeadmin-mongoid (0.6.0)
5
- activeadmin (>= 1.3.0)
10
+ activeadmin-mongoid (0.9.0)
11
+ activeadmin (>= 1.4.3)
6
12
  jquery-rails
13
+ kaminari-mongoid
7
14
  mongoid (~> 6.0)
8
15
  sass-rails (>= 3.1.4)
9
16
 
10
17
  GEM
11
18
  remote: https://rubygems.org/
12
19
  specs:
13
- actioncable (5.1.6)
14
- actionpack (= 5.1.6)
20
+ actioncable (5.2.3)
21
+ actionpack (= 5.2.3)
15
22
  nio4r (~> 2.0)
16
- websocket-driver (~> 0.6.1)
17
- actionmailer (5.1.6)
18
- actionpack (= 5.1.6)
19
- actionview (= 5.1.6)
20
- activejob (= 5.1.6)
23
+ websocket-driver (>= 0.6.1)
24
+ actionmailer (5.2.3)
25
+ actionpack (= 5.2.3)
26
+ actionview (= 5.2.3)
27
+ activejob (= 5.2.3)
21
28
  mail (~> 2.5, >= 2.5.4)
22
29
  rails-dom-testing (~> 2.0)
23
- actionpack (5.1.6)
24
- actionview (= 5.1.6)
25
- activesupport (= 5.1.6)
30
+ actionpack (5.2.3)
31
+ actionview (= 5.2.3)
32
+ activesupport (= 5.2.3)
26
33
  rack (~> 2.0)
27
34
  rack-test (>= 0.6.3)
28
35
  rails-dom-testing (~> 2.0)
29
36
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
- actionview (5.1.6)
31
- activesupport (= 5.1.6)
37
+ actionview (5.2.3)
38
+ activesupport (= 5.2.3)
32
39
  builder (~> 3.1)
33
40
  erubi (~> 1.4)
34
41
  rails-dom-testing (~> 2.0)
35
42
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
36
- activeadmin (1.3.0)
43
+ activeadmin (1.4.3)
37
44
  arbre (>= 1.1.1)
38
45
  coffee-rails
39
46
  formtastic (~> 3.1)
40
47
  formtastic_i18n
41
- inherited_resources (>= 1.7.0)
48
+ inherited_resources (>= 1.9.0)
42
49
  jquery-rails (>= 4.2.0)
43
50
  kaminari (>= 0.15)
44
51
  railties (>= 4.2, < 5.3)
45
- ransack (~> 1.3)
52
+ ransack (>= 1.8.7)
46
53
  sass (~> 3.1)
47
54
  sprockets (< 4.1)
48
- activejob (5.1.6)
49
- activesupport (= 5.1.6)
55
+ activejob (5.2.3)
56
+ activesupport (= 5.2.3)
50
57
  globalid (>= 0.3.6)
51
- activemodel (5.1.6)
52
- activesupport (= 5.1.6)
53
- activerecord (5.1.6)
54
- activemodel (= 5.1.6)
55
- activesupport (= 5.1.6)
56
- arel (~> 8.0)
57
- activesupport (5.1.6)
58
+ activemodel (5.2.3)
59
+ activesupport (= 5.2.3)
60
+ activerecord (5.2.3)
61
+ activemodel (= 5.2.3)
62
+ activesupport (= 5.2.3)
63
+ arel (>= 9.0)
64
+ activestorage (5.2.3)
65
+ actionpack (= 5.2.3)
66
+ activerecord (= 5.2.3)
67
+ marcel (~> 0.3.1)
68
+ activesupport (5.2.3)
58
69
  concurrent-ruby (~> 1.0, >= 1.0.2)
59
70
  i18n (>= 0.7, < 2)
60
71
  minitest (~> 5.1)
61
72
  tzinfo (~> 1.1)
62
73
  addressable (2.5.2)
63
74
  public_suffix (>= 2.0.2, < 4.0)
64
- arbre (1.1.1)
75
+ arbre (1.2.1)
65
76
  activesupport (>= 3.0.0)
66
- arel (8.0.0)
77
+ arel (9.0.0)
67
78
  bcrypt (3.1.12)
68
- bson (4.3.0)
79
+ bson (4.4.2)
69
80
  builder (3.2.3)
70
- capybara (2.15.1)
81
+ capybara (3.12.0)
71
82
  addressable
72
83
  mini_mime (>= 0.1.3)
73
- nokogiri (>= 1.3.3)
74
- rack (>= 1.0.0)
75
- rack-test (>= 0.5.4)
76
- xpath (~> 2.0)
84
+ nokogiri (~> 1.8)
85
+ rack (>= 1.6.0)
86
+ rack-test (>= 0.6.3)
87
+ regexp_parser (~> 1.2)
88
+ xpath (~> 3.2)
77
89
  cliver (0.3.2)
78
90
  coderay (1.1.2)
79
91
  coffee-rails (4.2.2)
@@ -83,33 +95,34 @@ GEM
83
95
  coffee-script-source
84
96
  execjs
85
97
  coffee-script-source (1.12.2)
86
- concurrent-ruby (1.0.5)
98
+ concurrent-ruby (1.1.5)
87
99
  crass (1.0.4)
88
- devise (4.4.3)
100
+ devise (4.6.2)
89
101
  bcrypt (~> 3.0)
90
102
  orm_adapter (~> 0.1)
91
103
  railties (>= 4.1.0, < 6.0)
92
104
  responders
93
105
  warden (~> 1.2.3)
94
- docile (1.1.5)
95
- erubi (1.7.1)
106
+ diff-lcs (1.3)
107
+ docile (1.3.1)
108
+ erubi (1.8.0)
96
109
  execjs (2.7.0)
97
- ffi (1.9.23)
110
+ ffi (1.10.0)
98
111
  formtastic (3.1.5)
99
112
  actionpack (>= 3.2.13)
100
113
  formtastic_i18n (0.6.0)
101
- globalid (0.4.1)
114
+ globalid (0.4.2)
102
115
  activesupport (>= 4.2.0)
103
116
  has_scope (0.7.2)
104
117
  actionpack (>= 4.1)
105
118
  activesupport (>= 4.1)
106
- i18n (1.0.1)
119
+ i18n (1.6.0)
107
120
  concurrent-ruby (~> 1.0)
108
- inherited_resources (1.8.0)
109
- actionpack (>= 4.2, <= 5.2)
121
+ inherited_resources (1.10.0)
122
+ actionpack (>= 5.0, < 6.0)
110
123
  has_scope (~> 0.6)
111
- railties (>= 4.2, <= 5.2)
112
- responders
124
+ railties (>= 5.0, < 6.0)
125
+ responders (~> 2.0)
113
126
  jquery-rails (4.3.3)
114
127
  rails-dom-testing (>= 1, < 3)
115
128
  railties (>= 4.2.0)
@@ -136,91 +149,110 @@ GEM
136
149
  mongoid
137
150
  launchy (2.4.3)
138
151
  addressable (~> 2.3)
139
- loofah (2.2.2)
152
+ loofah (2.2.3)
140
153
  crass (~> 1.0.2)
141
154
  nokogiri (>= 1.5.9)
142
- mail (2.7.0)
155
+ mail (2.7.1)
143
156
  mini_mime (>= 0.1.1)
144
- method_source (0.8.2)
145
- mini_mime (0.1.4)
146
- mini_portile2 (2.3.0)
157
+ marcel (0.3.3)
158
+ mimemagic (~> 0.3.2)
159
+ method_source (0.9.2)
160
+ mimemagic (0.3.3)
161
+ mini_mime (1.0.1)
162
+ mini_portile2 (2.4.0)
147
163
  minitest (5.11.3)
148
- mongo (2.5.1)
149
- bson (>= 4.3.0, < 5.0.0)
150
- mongoid (6.0.3)
151
- activemodel (~> 5.0)
152
- mongo (~> 2.3)
153
- nio4r (2.3.0)
154
- nokogiri (1.8.4)
155
- mini_portile2 (~> 2.3.0)
164
+ mongo (2.8.0)
165
+ bson (>= 4.4.2, < 5.0.0)
166
+ mongoid (6.4.2)
167
+ activemodel (>= 5.1, < 6.0.0)
168
+ mongo (>= 2.5.1, < 3.0.0)
169
+ nio4r (2.3.1)
170
+ nokogiri (1.10.2)
171
+ mini_portile2 (~> 2.4.0)
156
172
  orm_adapter (0.5.0)
157
- poltergeist (1.16.0)
158
- capybara (~> 2.1)
173
+ poltergeist (1.18.1)
174
+ capybara (>= 2.1, < 4)
159
175
  cliver (~> 0.3.1)
160
176
  websocket-driver (>= 0.2.0)
161
- polyamorous (1.3.3)
162
- activerecord (>= 3.0)
163
- pry (0.10.4)
177
+ pry (0.12.2)
164
178
  coderay (~> 1.1.0)
165
- method_source (~> 0.8.1)
166
- slop (~> 3.4)
167
- public_suffix (3.0.0)
168
- rack (2.0.5)
179
+ method_source (~> 0.9.0)
180
+ pry-rails (0.3.8)
181
+ pry (>= 0.10.4)
182
+ public_suffix (3.0.3)
183
+ rack (2.0.7)
169
184
  rack-test (1.1.0)
170
185
  rack (>= 1.0, < 3)
171
- rails (5.1.6)
172
- actioncable (= 5.1.6)
173
- actionmailer (= 5.1.6)
174
- actionpack (= 5.1.6)
175
- actionview (= 5.1.6)
176
- activejob (= 5.1.6)
177
- activemodel (= 5.1.6)
178
- activerecord (= 5.1.6)
179
- activesupport (= 5.1.6)
186
+ rails (5.2.3)
187
+ actioncable (= 5.2.3)
188
+ actionmailer (= 5.2.3)
189
+ actionpack (= 5.2.3)
190
+ actionview (= 5.2.3)
191
+ activejob (= 5.2.3)
192
+ activemodel (= 5.2.3)
193
+ activerecord (= 5.2.3)
194
+ activestorage (= 5.2.3)
195
+ activesupport (= 5.2.3)
180
196
  bundler (>= 1.3.0)
181
- railties (= 5.1.6)
197
+ railties (= 5.2.3)
182
198
  sprockets-rails (>= 2.0.0)
183
199
  rails-dom-testing (2.0.3)
184
200
  activesupport (>= 4.2.0)
185
201
  nokogiri (>= 1.6)
186
202
  rails-html-sanitizer (1.0.4)
187
203
  loofah (~> 2.2, >= 2.2.2)
188
- railties (5.1.6)
189
- actionpack (= 5.1.6)
190
- activesupport (= 5.1.6)
204
+ railties (5.2.3)
205
+ actionpack (= 5.2.3)
206
+ activesupport (= 5.2.3)
191
207
  method_source
192
208
  rake (>= 0.8.7)
193
- thor (>= 0.18.1, < 2.0)
194
- rake (12.3.1)
195
- ransack (1.8.6)
196
- actionpack (>= 3.0)
197
- activerecord (>= 3.0)
198
- activesupport (>= 3.0)
209
+ thor (>= 0.19.0, < 2.0)
210
+ rake (12.3.2)
211
+ ransack (2.1.1)
212
+ actionpack (>= 5.0)
213
+ activerecord (>= 5.0)
214
+ activesupport (>= 5.0)
199
215
  i18n
200
- polyamorous (~> 1.3.2)
201
216
  rb-fsevent (0.10.3)
202
- rb-inotify (0.9.10)
203
- ffi (>= 0.5.0, < 2)
204
- responders (2.4.0)
205
- actionpack (>= 4.2.0, < 5.3)
206
- railties (>= 4.2.0, < 5.3)
207
- sass (3.5.6)
217
+ rb-inotify (0.10.0)
218
+ ffi (~> 1.0)
219
+ regexp_parser (1.3.0)
220
+ responders (2.4.1)
221
+ actionpack (>= 4.2.0, < 6.0)
222
+ railties (>= 4.2.0, < 6.0)
223
+ rspec-core (3.8.0)
224
+ rspec-support (~> 3.8.0)
225
+ rspec-expectations (3.8.2)
226
+ diff-lcs (>= 1.2.0, < 2.0)
227
+ rspec-support (~> 3.8.0)
228
+ rspec-mocks (3.8.0)
229
+ diff-lcs (>= 1.2.0, < 2.0)
230
+ rspec-support (~> 3.8.0)
231
+ rspec-rails (3.8.1)
232
+ actionpack (>= 3.0)
233
+ activesupport (>= 3.0)
234
+ railties (>= 3.0)
235
+ rspec-core (~> 3.8.0)
236
+ rspec-expectations (~> 3.8.0)
237
+ rspec-mocks (~> 3.8.0)
238
+ rspec-support (~> 3.8.0)
239
+ rspec-support (3.8.0)
240
+ sass (3.7.4)
208
241
  sass-listen (~> 4.0.0)
209
242
  sass-listen (4.0.0)
210
243
  rb-fsevent (~> 0.9, >= 0.9.4)
211
244
  rb-inotify (~> 0.9, >= 0.9.7)
212
- sass-rails (5.0.6)
245
+ sass-rails (5.0.7)
213
246
  railties (>= 4.0.0, < 6)
214
247
  sass (~> 3.1)
215
248
  sprockets (>= 2.8, < 4.0)
216
249
  sprockets-rails (>= 2.0, < 4.0)
217
250
  tilt (>= 1.1, < 3)
218
- simplecov (0.15.1)
219
- docile (~> 1.1.0)
251
+ simplecov (0.16.1)
252
+ docile (~> 1.1)
220
253
  json (>= 1.8, < 3)
221
254
  simplecov-html (~> 0.10.0)
222
255
  simplecov-html (0.10.2)
223
- slop (3.6.0)
224
256
  sprockets (3.7.2)
225
257
  concurrent-ruby (~> 1.0)
226
258
  rack (> 1, < 3)
@@ -228,45 +260,36 @@ GEM
228
260
  actionpack (>= 4.0)
229
261
  activesupport (>= 4.0)
230
262
  sprockets (>= 3.0.0)
231
- thor (0.20.0)
263
+ thor (0.20.3)
232
264
  thread_safe (0.3.6)
233
- tilt (2.0.8)
265
+ tilt (2.0.9)
234
266
  tzinfo (1.2.5)
235
267
  thread_safe (~> 0.1)
236
- uglifier (3.2.0)
237
- execjs (>= 0.3.0, < 3)
238
- warden (1.2.7)
239
- rack (>= 1.0)
240
- websocket-driver (0.6.5)
268
+ warden (1.2.8)
269
+ rack (>= 2.0.6)
270
+ websocket-driver (0.7.0)
241
271
  websocket-extensions (>= 0.1.0)
242
272
  websocket-extensions (0.1.3)
243
- xpath (2.1.0)
244
- nokogiri (~> 1.3)
273
+ xpath (3.2.0)
274
+ nokogiri (~> 1.8)
245
275
 
246
276
  PLATFORMS
247
277
  ruby
248
278
 
249
279
  DEPENDENCIES
250
- activeadmin (~> 1.3.0)
251
280
  activeadmin-mongoid!
252
281
  capybara
253
- coffee-rails
254
282
  devise
255
283
  jquery-rails
256
284
  jquery-ui-rails
257
285
  jslint
258
- kaminari (~> 1.0)
259
- kaminari-mongoid
260
286
  launchy
261
- mongoid (~> 6.0.3)
262
287
  poltergeist
263
- pry
264
- rails (~> 5.1.6)
265
- ransack (< 1.8.7)
266
- sass-rails
288
+ pry-rails
289
+ rails (~> 5.2)
290
+ ransack-mongoid!
291
+ rspec-rails (~> 3.6)
267
292
  simplecov
268
- sprockets (>= 3.7.2)
269
- uglifier
270
293
 
271
294
  BUNDLED WITH
272
- 1.16.3
295
+ 1.17.3
data/README.md CHANGED
@@ -1,14 +1,17 @@
1
1
  # ActiveAdmin-Mongoid
2
+ [![Version ][rubygems_badge]][rubygems]
3
+ [![Build Status](https://travis-ci.org/activeadmin/activeadmin-mongoid.svg?branch=master)](https://travis-ci.org/activeadmin/activeadmin-mongoid)
2
4
 
3
5
  ## Updates
4
6
 
5
- ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin application. This repo was pulled into the ActiveAdmin org from previous work done by Elia Schito, and will be maintained by Nic Boie, JD Guzman, Elia Schito and other ActiveAdmin and community members.
7
+ ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin application. This repo was pulled into the ActiveAdmin org from previous work done by Elia Schito, and will be maintained by Grzegorz Jakubiak, Nic Boie, JD Guzman, Elia Schito and other ActiveAdmin and community members.
6
8
 
7
- ### Requirements for version 0.7.0
8
- * Ruby 2.2.2 or greater. (Note, ruby-2.4.0 fails specs, see [this issue](https://github.com/DatabaseCleaner/database_cleaner/issues/466))
9
- * Tested working on Rails 5.1.x
9
+ ### Requirements for version 0.9.0
10
+ * Ruby 2.3.0 or greater. (Note, ruby-2.4.0 fails specs, see [this issue](https://github.com/DatabaseCleaner/database_cleaner/issues/466))
11
+ * Tested working on Rails 5.2.3
10
12
  * Mongoid 6.x (**WARNING**:, using a Mongoid version >= 6.1.x has resulted in a fair amount of errors seen in the wild. Test your upgrade very carefully with any apps in which you're using this gem with Mongoid >= 6.1.x!)
11
- * ActiveAdmin 1.3
13
+ * ActiveAdmin 1.4.3
14
+ * `ransack-mongoid` - it needs to be explicitly declared in Gemfile, pointing to github's master since it has no releases on rubygems yet.
12
15
 
13
16
  ## Previous versions
14
17
  * Rails 4.x with Mongoid 5.x use branch rails4-mongoid5
@@ -19,9 +22,6 @@ ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin
19
22
 
20
23
  This gem has been brought into the ActiveAdmin org for support and maintenance.
21
24
 
22
- <!-- [![Build Status](https://secure.travis-ci.org/elia/activeadmin-mongoid.svg?branch=master)](http://travis-ci.org/elia/activeadmin-mongoid)
23
- [![Gem Version](https://badge.fury.io/rb/activeadmin-mongoid.svg)](http://badge.fury.io/rb/activeadmin-mongoid) -->
24
-
25
25
  # ActiveAdmin::Mongoid
26
26
 
27
27
  ActiveAdmin hacks to support Mongoid.
@@ -38,7 +38,8 @@ For more on Mongoid support in ActiveAdmin see [this issue](https://github.com/g
38
38
  Add the following gems to your application's Gemfile, and lock the version:
39
39
 
40
40
  ```ruby
41
- gem 'activeadmin-mongoid', '0.7.0'
41
+ gem 'activeadmin-mongoid', '0.8.0'
42
+ gem 'ransack-mongoid', github: 'activerecord-hackery/ransack-mongoid'
42
43
  ```
43
44
 
44
45
  You can safely remove the following lines, since are already activeadmin-mongoid dependencies:
@@ -99,3 +100,6 @@ And that's pretty much it !
99
100
  ## Copyright
100
101
 
101
102
  Copyright © 2012 Elia Schito. See LICENSE for details.
103
+
104
+ [rubygems_badge]: https://img.shields.io/gem/v/activeadmin-mongoid.svg
105
+ [rubygems]: https://rubygems.org/gems/activeadmin-mongoid
@@ -17,9 +17,12 @@ Gem::Specification.new do |gem|
17
17
  gem.require_paths = ['lib']
18
18
  gem.version = ActiveAdmin::Mongoid::VERSION
19
19
  gem.license = 'MIT'
20
+
21
+ gem.required_ruby_version = '>= 2.3'
20
22
 
21
23
  gem.add_runtime_dependency 'mongoid', ['~> 6.0']
22
- gem.add_runtime_dependency 'activeadmin', '>= 1.3.0'
24
+ gem.add_runtime_dependency 'activeadmin', '>= 1.4.3'
25
+ gem.add_runtime_dependency 'kaminari-mongoid'
23
26
  gem.add_runtime_dependency 'jquery-rails'
24
27
  gem.add_runtime_dependency 'sass-rails', ['>= 3.1.4']
25
28
 
@@ -2,13 +2,11 @@ require 'active_admin/mongoid/version'
2
2
  require 'active_model'
3
3
  require 'mongoid'
4
4
  require 'ransack'
5
- # require 'active_admin/mongoid/engine'
5
+ require 'kaminari/mongoid'
6
6
  require 'active_admin'
7
7
  require 'devise'
8
8
  require 'rails'
9
9
 
10
- # require 'active_admin/mongoid/comments'
11
- # require 'active_admin/mongoid/adaptor' # This appears to no longer be used.
12
10
  require 'active_admin/mongoid/filter_form_builder'
13
11
  require 'active_admin/mongoid/resource'
14
12
  require 'active_admin/mongoid/document'
@@ -32,14 +30,4 @@ module ActiveAdmin
32
30
  end
33
31
  end
34
32
  end
35
-
36
- # class << self
37
- # alias setup_without_mongoid setup
38
- #
39
- # # Load monkey patches *after* the setup process
40
- # def setup *args, &block
41
- # setup_without_mongoid *args, &block
42
- #
43
- # end
44
- # end
45
33
  end
@@ -1,5 +1,4 @@
1
1
  require 'delegate'
2
- # require 'meta_search/searches/mongoid'
3
2
 
4
3
  module ActiveAdmin::Mongoid::Document
5
4
  extend ActiveSupport::Concern
@@ -37,8 +36,6 @@ module ActiveAdmin::Mongoid::Document
37
36
  # CLASS METHODS
38
37
 
39
38
  included do
40
- # include MetaSearch::Searches::Mongoid
41
-
42
39
  unless respond_to? :primary_key
43
40
  class << self
44
41
  attr_accessor :primary_key
@@ -54,48 +51,6 @@ module ActiveAdmin::Mongoid::Document
54
51
  end
55
52
 
56
53
  module ClassMethods
57
-
58
- # Metasearch
59
-
60
- # def joins_values *args
61
- # criteria
62
- # end
63
-
64
- # def group_by *args, &block
65
- # criteria
66
- # end
67
-
68
- # def ransack *args
69
- # scoped
70
-
71
- # scoped.class.class_eval do
72
- # def result
73
- # self
74
- # end
75
- # end
76
-
77
- # scoped
78
- # end
79
-
80
-
81
- # Cache
82
-
83
- # def [] name
84
- # raise name.inspect
85
- # cache[name]
86
- # end
87
-
88
- # def []= name, value
89
- # cache[name]= value
90
- # end
91
-
92
- # def cache
93
- # @cache ||= {}
94
- # end
95
-
96
-
97
- # Columns
98
-
99
54
  def content_columns
100
55
  # cannot cache this, since changes in time (while defining fields)
101
56
  fields.map(&:second).reject do |f|
@@ -103,32 +58,6 @@ module ActiveAdmin::Mongoid::Document
103
58
  end
104
59
  end
105
60
 
106
- # def columns
107
- # @columns ||= fields.map(&:second).map{ |c| ColumnWrapper.new(c) }
108
- # end
109
-
110
- # def column_names
111
- # @column_names ||= fields.map(&:first)
112
- # end
113
-
114
- # def columns_hash
115
- # columns.index_by(&:name)
116
- # end
117
-
118
-
119
-
120
- # def reorder sorting
121
- # return unscoped if sorting.blank?
122
- # if sorting.match /\".*\".*/
123
- # options = sorting.split(/ |\./)
124
- # options.shift if options.count == 3
125
- # else
126
- # options = sorting.split(' ')
127
- # end
128
- # field, order = *options
129
- # unscoped.order_by(field => order)
130
- # end
131
-
132
61
  def connection
133
62
  @connection ||= Connection.new(self)
134
63
  end
@@ -153,4 +82,3 @@ module ActiveAdmin::Mongoid::Document
153
82
  end
154
83
 
155
84
  Mongoid::Document.send :include, ActiveAdmin::Mongoid::Document
156
- # Mongoid::Document.send :include, MetaSearch::Searches::Mongoid
@@ -3,7 +3,8 @@ require 'active_admin/filters/resource_extension'
3
3
  module ActiveAdmin::Filters::ResourceExtension
4
4
  def default_association_filters
5
5
  if resource_class.respond_to?(:reflect_on_all_associations)
6
- poly, not_poly = resource_class.reflect_on_all_associations.partition{ |r| r.macro == :belongs_to && r.options[:polymorphic] }
6
+ without_embedded = resource_class.reflect_on_all_associations.reject { |e| [:embeds_many, :embeds_one].include? e.macro }
7
+ poly, not_poly = without_embedded.partition{ |r| r.macro == :belongs_to && r.options[:polymorphic] }
7
8
 
8
9
  filters = poly.map(&:foreign_type) + not_poly.map(&:name)
9
10
  filters.map &:to_sym
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module Mongoid
3
- VERSION = '0.7.0'
3
+ VERSION = '0.9.0'
4
4
  end
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -15,7 +15,6 @@ Bundler.require
15
15
 
16
16
  require File.expand_path("../../test_app/config/environment", __FILE__)
17
17
  require 'rspec/rails'
18
- require 'rspec/autorun'
19
18
 
20
19
  # Requires supporting ruby files with custom matchers and macros, etc,
21
20
  # in spec/support/ and its subdirectories.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elia Schito
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-08-01 00:00:00.000000000 Z
14
+ date: 2019-04-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: mongoid
@@ -33,14 +33,28 @@ dependencies:
33
33
  requirements:
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 1.3.0
36
+ version: 1.4.3
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.3.0
43
+ version: 1.4.3
44
+ - !ruby/object:Gem::Dependency
45
+ name: kaminari-mongoid
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
44
58
  - !ruby/object:Gem::Dependency
45
59
  name: jquery-rails
46
60
  requirement: !ruby/object:Gem::Requirement
@@ -95,13 +109,12 @@ files:
95
109
  - ".travis.yml"
96
110
  - CONDUCT.md
97
111
  - Gemfile
112
+ - Gemfile.lock
98
113
  - LICENSE
99
114
  - README.md
100
115
  - Rakefile
101
116
  - activeadmin-mongoid.gemspec
102
117
  - lib/active_admin/mongoid.rb
103
- - lib/active_admin/mongoid/adaptor.rb
104
- - lib/active_admin/mongoid/comments.rb
105
118
  - lib/active_admin/mongoid/controllers/resource_controller.rb
106
119
  - lib/active_admin/mongoid/criteria.rb
107
120
  - lib/active_admin/mongoid/csv_builder.rb
@@ -130,8 +143,6 @@ files:
130
143
  - tasks/test.rake
131
144
  - test_app/.gitignore
132
145
  - test_app/.rspec
133
- - test_app/Gemfile
134
- - test_app/Gemfile.lock
135
146
  - test_app/README.rdoc
136
147
  - test_app/Rakefile
137
148
  - test_app/app/admin/admin_users.rb
@@ -212,7 +223,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
223
  requirements:
213
224
  - - ">="
214
225
  - !ruby/object:Gem::Version
215
- version: '0'
226
+ version: '2.3'
216
227
  required_rubygems_version: !ruby/object:Gem::Requirement
217
228
  requirements:
218
229
  - - ">="
@@ -220,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
231
  version: '0'
221
232
  requirements: []
222
233
  rubyforge_project:
223
- rubygems_version: 2.7.7
234
+ rubygems_version: 2.7.8
224
235
  signing_key:
225
236
  specification_version: 4
226
237
  summary: ActiveAdmin hacks to support Mongoid
@@ -1,65 +0,0 @@
1
- module ActiveAdmin
2
- module Mongoid
3
- class Search
4
- attr_reader :base, :query, :query_hash, :search_params
5
-
6
- def initialize(object, search_params = {}, per_page = 30, page = 1)
7
- @base = object
8
- @search_params = search_params
9
- @query_hash = get_query_hash(search_params)
10
- vpage = page.to_i > 0 ? page.to_i : 1
11
- @query = @base.where(@query_hash).limit(per_page).skip(per_page * (vpage - 1))
12
- end
13
-
14
- def respond_to?(method_id)
15
- @query.send(:respond_to?, method_id)
16
- end
17
-
18
- def method_missing(method_id, *args, &block)
19
- if is_query(method_id)
20
- @search_params[method_id.to_s]
21
- else
22
- @query.send(method_id, *args, &block)
23
- end
24
- end
25
-
26
- private
27
-
28
- def is_query(method_id)
29
- method_id.to_s =~ /_(contains|eq|in|gt|lt|gte|lte)$/
30
- end
31
-
32
- def get_query_hash(search_params)
33
- searches = search_params.map do|k, v|
34
- mongoidify_search(k,v)
35
- end
36
- Hash[searches]
37
- end
38
-
39
- def mongoidify_search(k, v)
40
- case k
41
- when /_contains$/
42
- [get_attribute(k, '_contains'), Regexp.new(Regexp.escape("#{v}"), Regexp::IGNORECASE)]
43
- when /_eq$/
44
- [get_attribute(k, '_eq'), v]
45
- when /_in$/
46
- [get_attribute(k, '_in').to_sym.in, v]
47
- when /_gt$/
48
- [get_attribute(k, "_gt").to_sym.gt, v]
49
- when /_lt$/
50
- [get_attribute(k, "_lt").to_sym.lt, v]
51
- when /_gte$/
52
- [get_attribute(k, "_gte").to_sym.gte, v]
53
- when /_lte$/
54
- [get_attribute(k, "_lte").to_sym.lte, v]
55
- else
56
- [k, v]
57
- end
58
- end
59
-
60
- def get_attribute(k, postfix)
61
- k.match(/^(.*)#{postfix}$/)[1]
62
- end
63
- end
64
- end
65
- end
@@ -1,14 +0,0 @@
1
- require 'active_admin/comments/namespace_helper'
2
- # ActiveAdmin::Application.allow_comments = false
3
-
4
- module ActiveAdmin
5
- module Comments
6
-
7
- module NamespaceHelper
8
- def comments?
9
- false
10
- end
11
- end
12
-
13
- end
14
- end
data/test_app/Gemfile DELETED
@@ -1,41 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'activeadmin-mongoid', path: '../'
4
- gem 'activeadmin', '~> 1.3.0'
5
-
6
- # Test app stuff
7
-
8
- gem 'rails', '~> 5.1.6'
9
-
10
- gem 'pry'
11
-
12
- gem 'devise'
13
-
14
- gem 'mongoid', '~> 6.0.3', require: true
15
- gem 'kaminari', '~> 1.0'
16
- gem 'kaminari-mongoid'
17
- gem 'ransack', '< 1.8.7'
18
-
19
- gem 'sprockets', '>= 3.7.2'
20
-
21
- # Gems used only for assets and not required
22
- # in production environments by default.
23
- gem 'sass-rails'
24
- gem 'coffee-rails'
25
-
26
- # See https://github.com/sstephenson/execjs#readme for more supported runtimes
27
- # gem 'therubyracer', :platforms => :ruby
28
- gem 'uglifier'
29
-
30
- gem 'jquery-rails'
31
- # gem "jquery-rails", "~> 2.3.0"
32
-
33
- gem 'jquery-ui-rails'
34
- gem 'jslint'
35
-
36
- group :test do
37
- gem 'capybara'
38
- gem 'poltergeist'
39
- gem 'launchy'
40
- gem 'simplecov', require: false
41
- end