activeadmin-mongoid 0.4.0 → 0.5.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile +2 -2
- data/README.md +1 -1
- data/activeadmin-mongoid.gemspec +3 -2
- data/lib/active_admin/mongoid.rb +1 -1
- data/lib/active_admin/mongoid/document.rb +4 -0
- data/lib/active_admin/mongoid/version.rb +1 -1
- data/spec/features/smoke_spec.rb +67 -35
- data/spec/lib/active_admin/mongoid/filter_form_builder_spec.rb +70 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/mongoid.rb +1 -0
- data/test_app/Gemfile +3 -3
- data/test_app/Gemfile.lock +271 -0
- data/test_app/app/admin/admin_users.rb +19 -18
- data/test_app/app/models/admin_user.rb +4 -16
- data/test_app/config/environments/test.rb +1 -1
- data/test_app/config/mongoid.6.yml +7 -0
- metadata +25 -8
- data/test_app/config/database.yml +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e9f120acaaf395aa38d6ec5e28808b9b9787a8f
|
4
|
+
data.tar.gz: 20d8ba53983c30ae6c260b0939c883ff9b9e17a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0518a45cca508af87daac9561642a1f978fa205770a8f2b6f461ca22a1948a8740307c7b4e31781f9284822ded7f1f003afbcd4adba19c05a7f50bd410250fb7'
|
7
|
+
data.tar.gz: 6d919998c4cc7b004bb5f91b2c2ee2eed1806ea79b7cd1e9e9d71296430bf2b9a19cfc5349355630116118b0ae110c9e3e41246d80b99ca6a2ee93acf307c682
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -5,11 +5,11 @@ source 'https://rubygems.org'
|
|
5
5
|
# development dependencies will be added by default to the :development group.
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem 'ransack', github: 'activerecord-hackery/ransack'
|
8
|
+
gem 'ransack', github: 'activerecord-hackery/ransack', ref: 'c869fc210500'
|
9
9
|
|
10
10
|
# Test app stuff
|
11
11
|
|
12
|
-
gem 'rails', '~> 5.
|
12
|
+
gem 'rails', '~> 5.1'
|
13
13
|
gem 'kaminari', '~> 1.0'
|
14
14
|
gem 'kaminari-mongoid'
|
15
15
|
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ ActiveAdmin is holding off on pulling Mongoid support into the core ActiveAdmin
|
|
8
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
9
|
* Requires Rails 5.0.x
|
10
10
|
* Mongoid 6.0.x
|
11
|
-
* ActiveAdmin 1.
|
11
|
+
* ActiveAdmin 1.1 (Not working above 1.1.0 at this time)
|
12
12
|
|
13
13
|
## Previous versions
|
14
14
|
* Rails 4.x with Mongoid 5.x use branch rails4-mongoid5
|
data/activeadmin-mongoid.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'active_admin/mongoid/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
-
gem.authors = ['Elia Schito', 'Nic Boie', 'JD Guzman']
|
7
|
+
gem.authors = ['Elia Schito', 'Nic Boie', 'JD Guzman', 'Grzegorz Jakubiak']
|
8
8
|
gem.email = ['elia@schito.me']
|
9
9
|
gem.description = %q{ActiveAdmin hacks to support Mongoid (some ActiveAdmin features are disabled)}
|
10
10
|
gem.summary = %q{ActiveAdmin hacks to support Mongoid}
|
@@ -19,10 +19,11 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.license = 'MIT'
|
20
20
|
|
21
21
|
gem.add_runtime_dependency 'mongoid', ['~> 6.0.3']
|
22
|
-
gem.add_runtime_dependency 'activeadmin', ['
|
22
|
+
gem.add_runtime_dependency 'activeadmin', ['<= 1.1.0']
|
23
23
|
gem.add_runtime_dependency 'jquery-rails'
|
24
24
|
gem.add_runtime_dependency 'sass-rails', ['>= 3.1.4', '<= 5.0.6']
|
25
25
|
# gem.add_runtime_dependency 'meta_search', '~> 1.1.3'
|
26
26
|
|
27
27
|
gem.add_development_dependency 'rspec-rails', '~> 3.6'
|
28
|
+
gem.add_development_dependency 'simplecov'
|
28
29
|
end
|
data/lib/active_admin/mongoid.rb
CHANGED
@@ -8,7 +8,7 @@ require 'devise'
|
|
8
8
|
require 'rails'
|
9
9
|
|
10
10
|
# require 'active_admin/mongoid/comments'
|
11
|
-
require 'active_admin/mongoid/adaptor'
|
11
|
+
# require 'active_admin/mongoid/adaptor' # This appears to no longer be used.
|
12
12
|
require 'active_admin/mongoid/filter_form_builder'
|
13
13
|
require 'active_admin/mongoid/resource'
|
14
14
|
require 'active_admin/mongoid/document'
|
data/spec/features/smoke_spec.rb
CHANGED
@@ -23,7 +23,7 @@ describe 'browse the test app' do
|
|
23
23
|
before do
|
24
24
|
visit '/admin'
|
25
25
|
|
26
|
-
I18n.t('active_admin.devise.login.submit').
|
26
|
+
expect(I18n.t('active_admin.devise.login.submit')).to eq('Login')
|
27
27
|
|
28
28
|
# Auth
|
29
29
|
fill_in 'Email', with: email
|
@@ -42,8 +42,8 @@ describe 'browse the test app' do
|
|
42
42
|
click_on 'Create Post'
|
43
43
|
|
44
44
|
within '.attributes_table.post' do
|
45
|
-
page.
|
46
|
-
page.
|
45
|
+
expect(page).to have_content('dhh screencast')
|
46
|
+
expect(page).to have_content('is still the best intro to rails')
|
47
47
|
end
|
48
48
|
|
49
49
|
# Edit
|
@@ -54,15 +54,15 @@ describe 'browse the test app' do
|
|
54
54
|
click_on 'Update Post'
|
55
55
|
|
56
56
|
within '.attributes_table.post' do
|
57
|
-
page.
|
58
|
-
page.
|
57
|
+
expect(page).to have_content('DHH original screencast')
|
58
|
+
expect(page).to have_content('is still the best intro to rails')
|
59
59
|
end
|
60
60
|
|
61
61
|
# List
|
62
62
|
within('.breadcrumb') { click_on 'Posts' }
|
63
63
|
within '#index_table_posts' do
|
64
|
-
page.
|
65
|
-
page.
|
64
|
+
expect(page).to have_content('DHH original screencast')
|
65
|
+
expect(page).to have_content('is still the best intro to rails')
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -81,17 +81,17 @@ describe 'browse the test app' do
|
|
81
81
|
click_on 'Filter'
|
82
82
|
|
83
83
|
within '#index_table_posts' do
|
84
|
-
page.
|
84
|
+
expect(page).to have_content('Quick Brown Fox')
|
85
85
|
end
|
86
86
|
|
87
87
|
fill_in 'Title', with: 'dog'
|
88
88
|
click_on 'Filter'
|
89
|
-
page.
|
89
|
+
expect(page).to_not have_content('Quick Brown Fox')
|
90
90
|
|
91
91
|
fill_in 'Title', with: ''
|
92
92
|
click_on 'Filter'
|
93
93
|
|
94
|
-
page.
|
94
|
+
expect(page).to have_content('Displaying 1 Post')
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -102,18 +102,18 @@ describe 'browse the test app' do
|
|
102
102
|
click_on 'Filter'
|
103
103
|
|
104
104
|
within '#index_table_posts' do
|
105
|
-
page.
|
105
|
+
expect(page).to have_content('Quick Brown Fox')
|
106
106
|
end
|
107
107
|
|
108
108
|
fill_in 'q[created_at_gteq_datetime]', with: 1.day.from_now.to_datetime.strftime("%Y-%m-%d")
|
109
109
|
click_on 'Filter'
|
110
|
-
page.
|
110
|
+
expect(page).to_not have_content('Quick Brown Fox')
|
111
111
|
|
112
112
|
fill_in 'q[created_at_gteq_datetime]', with: ''
|
113
113
|
fill_in 'q[created_at_lteq_datetime]', with: ''
|
114
114
|
click_on 'Filter'
|
115
115
|
|
116
|
-
page.
|
116
|
+
expect(page).to have_content('Displaying 1 Post')
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -126,12 +126,12 @@ describe 'browse the test app' do
|
|
126
126
|
click_on 'Filter'
|
127
127
|
|
128
128
|
within '#index_table_posts' do
|
129
|
-
page.
|
129
|
+
expect(page).to have_content('Quick Brown Fox')
|
130
130
|
end
|
131
131
|
|
132
132
|
fill_in 'View count', with: '6'
|
133
133
|
click_on 'Filter'
|
134
|
-
page.
|
134
|
+
expect(page).to_not have_content('Quick Brown Fox')
|
135
135
|
|
136
136
|
within '.filter_numeric' do
|
137
137
|
find(:select).find('option[value=view_count_less_than]').select_option
|
@@ -139,26 +139,26 @@ describe 'browse the test app' do
|
|
139
139
|
click_on 'Filter'
|
140
140
|
|
141
141
|
# within '#index_table_posts' do
|
142
|
-
# page.
|
142
|
+
# expect(page).to have_content('Quick Brown Fox')
|
143
143
|
# end
|
144
144
|
|
145
145
|
within '.filter_numeric' do
|
146
146
|
find(:select).find('option[value=view_count_greater_than]').select_option
|
147
147
|
end
|
148
148
|
click_on 'Filter'
|
149
|
-
page.
|
149
|
+
expect(page).to_not have_content('Quick Brown Fox')
|
150
150
|
|
151
151
|
fill_in 'View count', with: '4'
|
152
152
|
click_on 'Filter'
|
153
153
|
|
154
154
|
# within '#index_table_posts' do
|
155
|
-
# page.
|
155
|
+
# expect(page).to have_content('Quick Brown Fox')
|
156
156
|
# end
|
157
157
|
|
158
158
|
fill_in 'View count', with: ''
|
159
159
|
click_on 'Filter'
|
160
160
|
|
161
|
-
page.
|
161
|
+
expect(page).to have_content('Displaying 1 Post')
|
162
162
|
end
|
163
163
|
end
|
164
164
|
end
|
@@ -169,17 +169,17 @@ describe 'browse the test app' do
|
|
169
169
|
click_on 'Filter'
|
170
170
|
|
171
171
|
within '#index_table_posts' do
|
172
|
-
page.
|
172
|
+
expect(page).to have_content('Quick Brown Fox')
|
173
173
|
end
|
174
174
|
|
175
175
|
select other_email, from: 'Admin user'
|
176
176
|
click_on 'Filter'
|
177
|
-
page.
|
177
|
+
expect(page).to_not have_content('Quick Brown Fox')
|
178
178
|
|
179
179
|
select 'Any', from: 'Admin user'
|
180
180
|
click_on 'Filter'
|
181
181
|
|
182
|
-
page.
|
182
|
+
expect(page).to have_content('Displaying 1 Post')
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
@@ -187,20 +187,20 @@ describe 'browse the test app' do
|
|
187
187
|
it 'checks by other_user' do
|
188
188
|
check email
|
189
189
|
click_on 'Filter'
|
190
|
-
page.
|
190
|
+
expect(page).to_not have_content('Quick Brown Fox')
|
191
191
|
|
192
192
|
check other_email
|
193
193
|
click_on 'Filter'
|
194
194
|
|
195
195
|
within '#index_table_posts' do
|
196
|
-
page.
|
196
|
+
expect(page).to have_content('Quick Brown Fox')
|
197
197
|
end
|
198
198
|
|
199
199
|
uncheck email
|
200
200
|
uncheck other_email
|
201
201
|
click_on 'Filter'
|
202
202
|
|
203
|
-
page.
|
203
|
+
expect(page).to have_content('Displaying 1 Post')
|
204
204
|
end
|
205
205
|
end
|
206
206
|
end
|
@@ -222,10 +222,10 @@ describe 'browse the test app' do
|
|
222
222
|
it 'sorts by title' do
|
223
223
|
click_on 'Posts'
|
224
224
|
page.find('#index_table_posts > thead > tr > th > a', text: 'Title').click
|
225
|
-
page.first('#index_table_posts > tbody > tr').
|
225
|
+
expect(page.first('#index_table_posts > tbody > tr')).to have_content 'Quick Brown Fox'
|
226
226
|
|
227
227
|
page.find('#index_table_posts > thead > tr > th > a', text: 'Title').click
|
228
|
-
page.first('#index_table_posts > tbody > tr').
|
228
|
+
expect(page.first('#index_table_posts > tbody > tr')).to have_content 'First Post'
|
229
229
|
end
|
230
230
|
|
231
231
|
context 'with an embedded document' do
|
@@ -239,27 +239,27 @@ describe 'browse the test app' do
|
|
239
239
|
it 'sorts by the embedded document field' do
|
240
240
|
click_on 'Posts'
|
241
241
|
visit '/admin/posts?order=author.name_desc'
|
242
|
-
page.first('#index_table_posts > tbody > tr').
|
242
|
+
expect(page.first('#index_table_posts > tbody > tr')).to have_content 'Bob'
|
243
243
|
|
244
244
|
visit '/admin/posts?order=author.name_asc'
|
245
|
-
page.first('#index_table_posts > tbody > tr').
|
245
|
+
expect(page.first('#index_table_posts > tbody > tr')).to have_content 'Adam'
|
246
246
|
end
|
247
247
|
|
248
248
|
it 'sorts by embedded document fields of the the embedded document' do
|
249
249
|
click_on 'Posts'
|
250
250
|
visit '/admin/posts?order=author.city.name_desc'
|
251
|
-
page.first('#index_table_posts > tbody > tr').
|
251
|
+
expect(page.first('#index_table_posts > tbody > tr')).to have_content 'Washington'
|
252
252
|
|
253
253
|
visit '/admin/posts?order=author.city.name_asc'
|
254
|
-
page.first('#index_table_posts > tbody > tr').
|
254
|
+
expect(page.first('#index_table_posts > tbody > tr')).to have_content 'California'
|
255
255
|
end
|
256
256
|
end
|
257
257
|
end
|
258
258
|
|
259
259
|
describe "paginator" do
|
260
260
|
it "must have paginator with 4 pages" do
|
261
|
-
page.
|
262
|
-
page.all(:css, '.pagination > .page').size.
|
261
|
+
expect(page).to have_css('.pagination > .page.current')
|
262
|
+
expect(page.all(:css, '.pagination > .page').size).to eq(4)
|
263
263
|
end
|
264
264
|
|
265
265
|
it "must show each page correctly" do
|
@@ -268,7 +268,7 @@ describe 'browse the test app' do
|
|
268
268
|
|
269
269
|
(1..4).each do |page_number|
|
270
270
|
page.find('.pagination > .page > a', text: page_number).click
|
271
|
-
page.find('.pagination_information').
|
271
|
+
expect(page.find('.pagination_information')).to have_content('Displaying Posts')
|
272
272
|
|
273
273
|
offset = (page_number - 1) * per_page
|
274
274
|
collection_size = [per_page, posts_size - (page_number - 1) * per_page].min
|
@@ -278,10 +278,42 @@ describe 'browse the test app' do
|
|
278
278
|
from: offset + 1, to: offset + collection_size
|
279
279
|
display_total_text = Nokogiri::HTML(display_total_text).text.gsub(' ', ' ')
|
280
280
|
pagination_information = page.find('.pagination_information').text
|
281
|
-
pagination_information.
|
281
|
+
expect(pagination_information).to include(display_total_text)
|
282
282
|
end
|
283
283
|
end
|
284
284
|
end
|
285
285
|
end # context 'with 100 posts'
|
286
|
+
|
287
|
+
describe 'viewing admin users' do
|
288
|
+
it 'includes our admin user' do
|
289
|
+
visit '/admin/admin_users'
|
290
|
+
expect(page).to have_content(admin_user.email)
|
291
|
+
end
|
292
|
+
|
293
|
+
describe 'search' do
|
294
|
+
context 'found record' do
|
295
|
+
it 'returns a row in the table with the found record' do
|
296
|
+
AdminUser.create(email: 'foo@barbiz.com', password: password)
|
297
|
+
visit '/admin/admin_users'
|
298
|
+
fill_in 'q_email', with: 'barbiz'
|
299
|
+
click_button('Filter')
|
300
|
+
within '#index_table_admin_users' do
|
301
|
+
expect(page).to have_content('barbiz')
|
302
|
+
end
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
context 'no records found' do
|
307
|
+
it 'indicates that no records were found' do
|
308
|
+
visit '/admin/admin_users'
|
309
|
+
fill_in 'q_email', with: 'foobar'
|
310
|
+
click_button('Filter')
|
311
|
+
expect(page).to_not have_content 'No Admin Users Found'
|
312
|
+
end
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
|
317
|
+
end
|
286
318
|
end
|
287
319
|
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ActiveAdmin::Filters::FormBuilder do
|
4
|
+
describe '#default_input_type' do
|
5
|
+
let(:instance) { described_class.new({}, {}, {}, {}) }
|
6
|
+
let(:column) { double(:column) }
|
7
|
+
subject { instance.default_input_type(nil) }
|
8
|
+
|
9
|
+
before do
|
10
|
+
allow(column).to receive_message_chain('type.name.downcase.to_sym')
|
11
|
+
.and_return(column_symbol)
|
12
|
+
allow(instance).to receive(:column_for).with(anything).and_return(column)
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'date_range' do
|
16
|
+
%i(date datetime time).each do |meth|
|
17
|
+
let(:column_symbol) { meth }
|
18
|
+
it { is_expected.to eq :date_range }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'string' do
|
23
|
+
%i(string text object).each do |meth|
|
24
|
+
let(:column_symbol) { meth }
|
25
|
+
it { is_expected.to eq :string }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'numeric' do
|
30
|
+
%i(float decimal).each do |meth|
|
31
|
+
let(:column_symbol) { meth }
|
32
|
+
it { is_expected.to eq :numeric }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'integer' do
|
37
|
+
let(:column_symbol) { :integer }
|
38
|
+
context 'select' do
|
39
|
+
before { allow(instance).to receive(:reflection_for).and_return(true) }
|
40
|
+
it { is_expected.to eq :select }
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'numeric' do
|
44
|
+
before { allow(instance).to receive(:reflection_for).and_return(false) }
|
45
|
+
it { is_expected.to eq :numeric }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'association' do
|
50
|
+
before { allow(instance).to receive(:column_for).and_return(nil) }
|
51
|
+
before { allow(instance).to receive(:is_association?).and_return(true) }
|
52
|
+
let(:column_symbol) { :foobar }
|
53
|
+
it { is_expected.to eq :select }
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'unknown' do
|
57
|
+
before { allow(instance).to receive(:column_for).and_return(nil) }
|
58
|
+
before { allow(instance).to receive(:is_association?).and_return(false) }
|
59
|
+
let(:column_symbol) { :bizbaz }
|
60
|
+
it { is_expected.to eq :string }
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
# when :date, :datetime, :time; :date_range
|
65
|
+
# when :string, :text, :object; :string
|
66
|
+
# when :float, :decimal; :numeric
|
67
|
+
# when :integer
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/mongoid.rb
CHANGED
data/test_app/Gemfile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'activeadmin'
|
4
|
-
gem 'activeadmin
|
3
|
+
gem 'activeadmin-mongoid', path: '../'
|
4
|
+
gem 'activeadmin', '<= 1.1.0'
|
5
5
|
|
6
6
|
# Test app stuff
|
7
7
|
|
8
|
-
gem 'rails', '~> 5.
|
8
|
+
gem 'rails', '~> 5.1.6'
|
9
9
|
|
10
10
|
gem 'pry'
|
11
11
|
|
@@ -0,0 +1,271 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
activeadmin-mongoid (0.4.0)
|
5
|
+
activeadmin (<= 1.1.0)
|
6
|
+
jquery-rails
|
7
|
+
mongoid (~> 6.0.3)
|
8
|
+
sass-rails (>= 3.1.4, <= 5.0.6)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
actioncable (5.1.6)
|
14
|
+
actionpack (= 5.1.6)
|
15
|
+
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)
|
21
|
+
mail (~> 2.5, >= 2.5.4)
|
22
|
+
rails-dom-testing (~> 2.0)
|
23
|
+
actionpack (5.1.6)
|
24
|
+
actionview (= 5.1.6)
|
25
|
+
activesupport (= 5.1.6)
|
26
|
+
rack (~> 2.0)
|
27
|
+
rack-test (>= 0.6.3)
|
28
|
+
rails-dom-testing (~> 2.0)
|
29
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
30
|
+
actionview (5.1.6)
|
31
|
+
activesupport (= 5.1.6)
|
32
|
+
builder (~> 3.1)
|
33
|
+
erubi (~> 1.4)
|
34
|
+
rails-dom-testing (~> 2.0)
|
35
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
36
|
+
activeadmin (1.1.0)
|
37
|
+
arbre (>= 1.1.1)
|
38
|
+
coffee-rails
|
39
|
+
formtastic (~> 3.1)
|
40
|
+
formtastic_i18n
|
41
|
+
inherited_resources (~> 1.7)
|
42
|
+
jquery-rails
|
43
|
+
kaminari (>= 0.15, < 2.0)
|
44
|
+
railties (>= 4.2, < 5.2)
|
45
|
+
ransack (~> 1.3)
|
46
|
+
sass (~> 3.1)
|
47
|
+
sprockets (< 4.1)
|
48
|
+
activejob (5.1.6)
|
49
|
+
activesupport (= 5.1.6)
|
50
|
+
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
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
59
|
+
i18n (>= 0.7, < 2)
|
60
|
+
minitest (~> 5.1)
|
61
|
+
tzinfo (~> 1.1)
|
62
|
+
addressable (2.5.2)
|
63
|
+
public_suffix (>= 2.0.2, < 4.0)
|
64
|
+
arbre (1.1.1)
|
65
|
+
activesupport (>= 3.0.0)
|
66
|
+
arel (8.0.0)
|
67
|
+
bcrypt (3.1.11)
|
68
|
+
bson (4.2.2)
|
69
|
+
builder (3.2.3)
|
70
|
+
capybara (2.15.1)
|
71
|
+
addressable
|
72
|
+
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)
|
77
|
+
cliver (0.3.2)
|
78
|
+
coderay (1.1.2)
|
79
|
+
coffee-rails (4.2.2)
|
80
|
+
coffee-script (>= 2.2.0)
|
81
|
+
railties (>= 4.0.0)
|
82
|
+
coffee-script (2.4.1)
|
83
|
+
coffee-script-source
|
84
|
+
execjs
|
85
|
+
coffee-script-source (1.12.2)
|
86
|
+
concurrent-ruby (1.0.5)
|
87
|
+
crass (1.0.4)
|
88
|
+
devise (4.3.0)
|
89
|
+
bcrypt (~> 3.0)
|
90
|
+
orm_adapter (~> 0.1)
|
91
|
+
railties (>= 4.1.0, < 5.2)
|
92
|
+
responders
|
93
|
+
warden (~> 1.2.3)
|
94
|
+
docile (1.1.5)
|
95
|
+
erubi (1.7.1)
|
96
|
+
execjs (2.7.0)
|
97
|
+
ffi (1.9.18)
|
98
|
+
formtastic (3.1.5)
|
99
|
+
actionpack (>= 3.2.13)
|
100
|
+
formtastic_i18n (0.6.0)
|
101
|
+
globalid (0.4.1)
|
102
|
+
activesupport (>= 4.2.0)
|
103
|
+
has_scope (0.7.1)
|
104
|
+
actionpack (>= 4.1, < 5.2)
|
105
|
+
activesupport (>= 4.1, < 5.2)
|
106
|
+
i18n (1.0.0)
|
107
|
+
concurrent-ruby (~> 1.0)
|
108
|
+
inherited_resources (1.7.2)
|
109
|
+
actionpack (>= 3.2, < 5.2.x)
|
110
|
+
has_scope (~> 0.6)
|
111
|
+
railties (>= 3.2, < 5.2.x)
|
112
|
+
responders
|
113
|
+
jquery-rails (4.3.1)
|
114
|
+
rails-dom-testing (>= 1, < 3)
|
115
|
+
railties (>= 4.2.0)
|
116
|
+
thor (>= 0.14, < 2.0)
|
117
|
+
jquery-ui-rails (6.0.1)
|
118
|
+
railties (>= 3.2.16)
|
119
|
+
jslint (1.2.0)
|
120
|
+
json
|
121
|
+
json (2.1.0)
|
122
|
+
kaminari (1.0.1)
|
123
|
+
activesupport (>= 4.1.0)
|
124
|
+
kaminari-actionview (= 1.0.1)
|
125
|
+
kaminari-activerecord (= 1.0.1)
|
126
|
+
kaminari-core (= 1.0.1)
|
127
|
+
kaminari-actionview (1.0.1)
|
128
|
+
actionview
|
129
|
+
kaminari-core (= 1.0.1)
|
130
|
+
kaminari-activerecord (1.0.1)
|
131
|
+
activerecord
|
132
|
+
kaminari-core (= 1.0.1)
|
133
|
+
kaminari-core (1.0.1)
|
134
|
+
kaminari-mongoid (1.0.1)
|
135
|
+
kaminari-core (~> 1.0)
|
136
|
+
mongoid
|
137
|
+
launchy (2.4.3)
|
138
|
+
addressable (~> 2.3)
|
139
|
+
loofah (2.2.2)
|
140
|
+
crass (~> 1.0.2)
|
141
|
+
nokogiri (>= 1.5.9)
|
142
|
+
mail (2.7.0)
|
143
|
+
mini_mime (>= 0.1.1)
|
144
|
+
method_source (0.8.2)
|
145
|
+
mini_mime (0.1.4)
|
146
|
+
mini_portile2 (2.3.0)
|
147
|
+
minitest (5.11.3)
|
148
|
+
mongo (2.4.3)
|
149
|
+
bson (>= 4.2.1, < 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.2)
|
155
|
+
mini_portile2 (~> 2.3.0)
|
156
|
+
orm_adapter (0.5.0)
|
157
|
+
poltergeist (1.16.0)
|
158
|
+
capybara (~> 2.1)
|
159
|
+
cliver (~> 0.3.1)
|
160
|
+
websocket-driver (>= 0.2.0)
|
161
|
+
polyamorous (1.3.1)
|
162
|
+
activerecord (>= 3.0)
|
163
|
+
pry (0.10.4)
|
164
|
+
coderay (~> 1.1.0)
|
165
|
+
method_source (~> 0.8.1)
|
166
|
+
slop (~> 3.4)
|
167
|
+
public_suffix (3.0.0)
|
168
|
+
rack (2.0.4)
|
169
|
+
rack-test (1.0.0)
|
170
|
+
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)
|
180
|
+
bundler (>= 1.3.0)
|
181
|
+
railties (= 5.1.6)
|
182
|
+
sprockets-rails (>= 2.0.0)
|
183
|
+
rails-dom-testing (2.0.3)
|
184
|
+
activesupport (>= 4.2.0)
|
185
|
+
nokogiri (>= 1.6)
|
186
|
+
rails-html-sanitizer (1.0.4)
|
187
|
+
loofah (~> 2.2, >= 2.2.2)
|
188
|
+
railties (5.1.6)
|
189
|
+
actionpack (= 5.1.6)
|
190
|
+
activesupport (= 5.1.6)
|
191
|
+
method_source
|
192
|
+
rake (>= 0.8.7)
|
193
|
+
thor (>= 0.18.1, < 2.0)
|
194
|
+
rake (12.3.1)
|
195
|
+
ransack (1.8.3)
|
196
|
+
actionpack (>= 3.0)
|
197
|
+
activerecord (>= 3.0)
|
198
|
+
activesupport (>= 3.0)
|
199
|
+
i18n
|
200
|
+
polyamorous (~> 1.3)
|
201
|
+
rb-fsevent (0.10.2)
|
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.1)
|
208
|
+
sass-listen (~> 4.0.0)
|
209
|
+
sass-listen (4.0.0)
|
210
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
211
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
212
|
+
sass-rails (5.0.6)
|
213
|
+
railties (>= 4.0.0, < 6)
|
214
|
+
sass (~> 3.1)
|
215
|
+
sprockets (>= 2.8, < 4.0)
|
216
|
+
sprockets-rails (>= 2.0, < 4.0)
|
217
|
+
tilt (>= 1.1, < 3)
|
218
|
+
simplecov (0.15.1)
|
219
|
+
docile (~> 1.1.0)
|
220
|
+
json (>= 1.8, < 3)
|
221
|
+
simplecov-html (~> 0.10.0)
|
222
|
+
simplecov-html (0.10.2)
|
223
|
+
slop (3.6.0)
|
224
|
+
sprockets (3.7.1)
|
225
|
+
concurrent-ruby (~> 1.0)
|
226
|
+
rack (> 1, < 3)
|
227
|
+
sprockets-rails (3.2.1)
|
228
|
+
actionpack (>= 4.0)
|
229
|
+
activesupport (>= 4.0)
|
230
|
+
sprockets (>= 3.0.0)
|
231
|
+
thor (0.20.0)
|
232
|
+
thread_safe (0.3.6)
|
233
|
+
tilt (2.0.8)
|
234
|
+
tzinfo (1.2.5)
|
235
|
+
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)
|
241
|
+
websocket-extensions (>= 0.1.0)
|
242
|
+
websocket-extensions (0.1.3)
|
243
|
+
xpath (2.1.0)
|
244
|
+
nokogiri (~> 1.3)
|
245
|
+
|
246
|
+
PLATFORMS
|
247
|
+
ruby
|
248
|
+
|
249
|
+
DEPENDENCIES
|
250
|
+
activeadmin (<= 1.1.0)
|
251
|
+
activeadmin-mongoid!
|
252
|
+
capybara
|
253
|
+
coffee-rails
|
254
|
+
devise
|
255
|
+
jquery-rails
|
256
|
+
jquery-ui-rails
|
257
|
+
jslint
|
258
|
+
kaminari (~> 1.0)
|
259
|
+
kaminari-mongoid
|
260
|
+
launchy
|
261
|
+
mongoid (~> 6.0.3)
|
262
|
+
poltergeist
|
263
|
+
pry
|
264
|
+
rails (~> 5.1.6)
|
265
|
+
ransack
|
266
|
+
sass-rails
|
267
|
+
simplecov
|
268
|
+
uglifier
|
269
|
+
|
270
|
+
BUNDLED WITH
|
271
|
+
1.16.1
|
@@ -1,20 +1,21 @@
|
|
1
|
-
ActiveAdmin.register AdminUser do
|
2
|
-
index do
|
3
|
-
column :email
|
4
|
-
column :current_sign_in_at
|
5
|
-
column :last_sign_in_at
|
6
|
-
column :sign_in_count
|
7
|
-
|
8
|
-
end
|
1
|
+
ActiveAdmin.register AdminUser do
|
2
|
+
index do
|
3
|
+
column :email
|
4
|
+
column :current_sign_in_at
|
5
|
+
column :last_sign_in_at
|
6
|
+
column :sign_in_count
|
7
|
+
actions
|
8
|
+
end
|
9
9
|
|
10
|
-
filter :email
|
10
|
+
filter :email
|
11
|
+
filter :posts
|
11
12
|
|
12
|
-
form do |f|
|
13
|
-
f.inputs "Admin Details" do
|
14
|
-
f.input :email
|
15
|
-
f.input :password
|
16
|
-
f.input :password_confirmation
|
17
|
-
end
|
18
|
-
f.actions
|
19
|
-
end
|
20
|
-
end
|
13
|
+
form do |f|
|
14
|
+
f.inputs "Admin Details" do
|
15
|
+
f.input :email
|
16
|
+
f.input :password
|
17
|
+
f.input :password_confirmation
|
18
|
+
end
|
19
|
+
f.actions
|
20
|
+
end
|
21
|
+
end
|
@@ -3,13 +3,13 @@ class AdminUser
|
|
3
3
|
# Include default devise modules. Others available are:
|
4
4
|
# :token_authenticatable, :confirmable,
|
5
5
|
# :lockable, :timeoutable and :omniauthable
|
6
|
-
devise :database_authenticatable,
|
6
|
+
devise :database_authenticatable,
|
7
7
|
:recoverable, :rememberable, :trackable, :validatable
|
8
8
|
|
9
9
|
## Database authenticatable
|
10
10
|
field :email, :type => String, :default => ""
|
11
11
|
field :encrypted_password, :type => String, :default => ""
|
12
|
-
|
12
|
+
|
13
13
|
## Recoverable
|
14
14
|
field :reset_password_token, :type => String
|
15
15
|
field :reset_password_sent_at, :type => Time
|
@@ -24,20 +24,8 @@ class AdminUser
|
|
24
24
|
field :current_sign_in_ip, :type => String
|
25
25
|
field :last_sign_in_ip, :type => String
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
# field :confirmed_at, :type => Time
|
30
|
-
# field :confirmation_sent_at, :type => Time
|
31
|
-
# field :unconfirmed_email, :type => String # Only if using reconfirmable
|
32
|
-
|
33
|
-
## Lockable
|
34
|
-
# field :failed_attempts, :type => Integer, :default => 0 # Only if lock strategy is :failed_attempts
|
35
|
-
# field :unlock_token, :type => String # Only if unlock strategy is :email or :both
|
36
|
-
# field :locked_at, :type => Time
|
37
|
-
|
38
|
-
## Token authenticatable
|
39
|
-
# field :authentication_token, :type => String
|
40
|
-
|
27
|
+
has_many :posts
|
28
|
+
|
41
29
|
def name
|
42
30
|
email
|
43
31
|
end
|
@@ -11,7 +11,7 @@ Rails.application.configure do
|
|
11
11
|
|
12
12
|
# Configure static asset server for tests with Cache-Control for performance
|
13
13
|
config.serve_static_assets = true
|
14
|
-
config.
|
14
|
+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
15
15
|
|
16
16
|
# Log error messages when you accidentally call methods on nil
|
17
17
|
# config.whiny_nils = true
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin-mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elia Schito
|
8
8
|
- Nic Boie
|
9
9
|
- JD Guzman
|
10
|
+
- Grzegorz Jakubiak
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date:
|
14
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: mongoid
|
@@ -30,16 +31,16 @@ dependencies:
|
|
30
31
|
name: activeadmin
|
31
32
|
requirement: !ruby/object:Gem::Requirement
|
32
33
|
requirements:
|
33
|
-
- - "
|
34
|
+
- - "<="
|
34
35
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
36
|
+
version: 1.1.0
|
36
37
|
type: :runtime
|
37
38
|
prerelease: false
|
38
39
|
version_requirements: !ruby/object:Gem::Requirement
|
39
40
|
requirements:
|
40
|
-
- - "
|
41
|
+
- - "<="
|
41
42
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
43
|
+
version: 1.1.0
|
43
44
|
- !ruby/object:Gem::Dependency
|
44
45
|
name: jquery-rails
|
45
46
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +89,20 @@ dependencies:
|
|
88
89
|
- - "~>"
|
89
90
|
- !ruby/object:Gem::Version
|
90
91
|
version: '3.6'
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: simplecov
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
91
106
|
description: ActiveAdmin hacks to support Mongoid (some ActiveAdmin features are disabled)
|
92
107
|
email:
|
93
108
|
- elia@schito.me
|
@@ -120,6 +135,7 @@ files:
|
|
120
135
|
- lib/meta_search/searches/mongoid.rb
|
121
136
|
- lib/tasks/activeadmin-mongoid_tasks.rake
|
122
137
|
- spec/features/smoke_spec.rb
|
138
|
+
- spec/lib/active_admin/mongoid/filter_form_builder_spec.rb
|
123
139
|
- spec/spec_helper.rb
|
124
140
|
- spec/support/capybara.rb
|
125
141
|
- spec/support/debug.rb
|
@@ -129,6 +145,7 @@ files:
|
|
129
145
|
- test_app/.gitignore
|
130
146
|
- test_app/.rspec
|
131
147
|
- test_app/Gemfile
|
148
|
+
- test_app/Gemfile.lock
|
132
149
|
- test_app/README.rdoc
|
133
150
|
- test_app/Rakefile
|
134
151
|
- test_app/app/admin/admin_users.rb
|
@@ -151,7 +168,6 @@ files:
|
|
151
168
|
- test_app/config.ru
|
152
169
|
- test_app/config/application.rb
|
153
170
|
- test_app/config/boot.rb
|
154
|
-
- test_app/config/database.yml
|
155
171
|
- test_app/config/environment.rb
|
156
172
|
- test_app/config/environments/development.rb
|
157
173
|
- test_app/config/environments/production.rb
|
@@ -218,12 +234,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
234
|
version: '0'
|
219
235
|
requirements: []
|
220
236
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.6.
|
237
|
+
rubygems_version: 2.6.12
|
222
238
|
signing_key:
|
223
239
|
specification_version: 4
|
224
240
|
summary: ActiveAdmin hacks to support Mongoid
|
225
241
|
test_files:
|
226
242
|
- spec/features/smoke_spec.rb
|
243
|
+
- spec/lib/active_admin/mongoid/filter_form_builder_spec.rb
|
227
244
|
- spec/spec_helper.rb
|
228
245
|
- spec/support/capybara.rb
|
229
246
|
- spec/support/debug.rb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# SQLite version 3.x
|
2
|
-
# gem install sqlite3
|
3
|
-
#
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
-
# gem 'sqlite3'
|
6
|
-
development:
|
7
|
-
adapter: sqlite3
|
8
|
-
database: db/development.sqlite3
|
9
|
-
pool: 5
|
10
|
-
timeout: 5000
|
11
|
-
|
12
|
-
# Warning: The database defined as "test" will be erased and
|
13
|
-
# re-generated from your development database when you run "rake".
|
14
|
-
# Do not set this db to the same as development or production.
|
15
|
-
test:
|
16
|
-
adapter: sqlite3
|
17
|
-
database: ":memory:"
|
18
|
-
pool: 5
|
19
|
-
timeout: 5000
|
20
|
-
|
21
|
-
production:
|
22
|
-
adapter: sqlite3
|
23
|
-
database: db/production.sqlite3
|
24
|
-
pool: 5
|
25
|
-
timeout: 5000
|