activeadmin-mongoid 0.3.0 → 0.4.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/.travis.yml +3 -2
- data/CONDUCT.md +13 -0
- data/Gemfile +9 -3
- data/README.md +30 -7
- data/activeadmin-mongoid.gemspec +7 -7
- data/lib/active_admin/mongoid.rb +6 -2
- data/lib/active_admin/mongoid/document.rb +54 -48
- data/lib/active_admin/mongoid/filter_form_builder.rb +9 -2
- data/lib/active_admin/mongoid/helpers/collection.rb +12 -2
- data/lib/active_admin/mongoid/order_clause.rb +12 -0
- data/lib/active_admin/mongoid/resource.rb +21 -51
- data/lib/active_admin/mongoid/version.rb +1 -1
- data/spec/features/smoke_spec.rb +52 -15
- data/spec/spec_helper.rb +5 -3
- data/spec/support/debug.rb +3 -0
- data/{test_app/config/_link_mongoid_config.rb → spec/support/mongoid.rb} +3 -1
- data/test_app/Gemfile +39 -0
- data/test_app/app/admin/posts.rb +34 -0
- data/test_app/app/assets/javascripts/active_admin.js +4 -4
- data/test_app/app/models/author.rb +9 -0
- data/test_app/app/models/city.rb +7 -0
- data/test_app/app/models/post.rb +3 -0
- data/test_app/config/application.rb +8 -14
- data/test_app/config/boot.rb +1 -1
- data/test_app/config/environment.rb +1 -1
- data/test_app/config/environments/development.rb +1 -1
- data/test_app/config/environments/production.rb +1 -1
- data/test_app/config/environments/test.rb +4 -2
- data/test_app/config/initializers/active_admin.rb +6 -3
- data/test_app/config/initializers/i18n.rb +1 -0
- data/test_app/config/initializers/mongoid.rb +1 -0
- data/test_app/config/initializers/secret_token.rb +1 -1
- data/test_app/config/initializers/session_store.rb +1 -1
- data/test_app/config/mongoid.4.yml +87 -0
- data/test_app/config/mongoid.5.yml +7 -0
- data/test_app/config/mongoid.6.yml +7 -0
- data/test_app/config/routes.rb +1 -1
- metadata +46 -51
@@ -0,0 +1,87 @@
|
|
1
|
+
test:
|
2
|
+
# Configure available database sessions. (required)
|
3
|
+
sessions:
|
4
|
+
# Defines the default session. (required)
|
5
|
+
default:
|
6
|
+
# Defines the name of the default database that Mongoid can connect to.
|
7
|
+
# (required).
|
8
|
+
database: activeadmin_mongoid_test
|
9
|
+
# Provides the hosts the default session can connect to. Must be an array
|
10
|
+
# of host:port pairs. (required)
|
11
|
+
hosts:
|
12
|
+
- localhost:27017
|
13
|
+
options:
|
14
|
+
# Change whether the session persists in safe mode by default.
|
15
|
+
# (default: false)
|
16
|
+
# safe: false
|
17
|
+
|
18
|
+
# Change the default consistency model to :eventual or :strong.
|
19
|
+
# :eventual will send reads to secondaries, :strong sends everything
|
20
|
+
# to master. (default: :eventual)
|
21
|
+
# consistency: :eventual
|
22
|
+
|
23
|
+
# How many times Moped should attempt to retry an operation after
|
24
|
+
# failure. (default: 30)
|
25
|
+
# max_retries: 30
|
26
|
+
|
27
|
+
# The time in seconds that Moped should wait before retrying an
|
28
|
+
# operation on failure. (default: 1)
|
29
|
+
# retry_interval: 1
|
30
|
+
# Configure Mongoid specific options. (optional)
|
31
|
+
options: &default_options
|
32
|
+
# Includes the root model name in json serialization. (default: false)
|
33
|
+
# include_root_in_json: false
|
34
|
+
|
35
|
+
# Include the _type field in serializaion. (default: false)
|
36
|
+
# include_type_for_serialization: false
|
37
|
+
|
38
|
+
# Preload all models in development, needed when models use
|
39
|
+
# inheritance. (default: false)
|
40
|
+
# preload_models: false
|
41
|
+
|
42
|
+
# Protect id and type from mass assignment. (default: true)
|
43
|
+
# protect_sensitive_fields: true
|
44
|
+
|
45
|
+
# Raise an error when performing a #find and the document is not found.
|
46
|
+
# (default: true)
|
47
|
+
# raise_not_found_error: true
|
48
|
+
|
49
|
+
# Raise an error when defining a scope with the same name as an
|
50
|
+
# existing method. (default: false)
|
51
|
+
scope_overwrite_exception: true
|
52
|
+
|
53
|
+
# Skip the database version check, used when connecting to a db without
|
54
|
+
# admin access. (default: false)
|
55
|
+
# skip_version_check: false
|
56
|
+
|
57
|
+
# User Active Support's time zone in conversions. (default: true)
|
58
|
+
# use_activesupport_time_zone: true
|
59
|
+
|
60
|
+
# Ensure all times are UTC in the app side. (default: false)
|
61
|
+
# use_utc: false
|
62
|
+
|
63
|
+
# production:
|
64
|
+
# sessions:
|
65
|
+
# default:
|
66
|
+
# uri: <%= ENV['MONGOLAB_URI'] %>
|
67
|
+
# options:
|
68
|
+
# skip_version_check: true
|
69
|
+
# identity_map_enabled: true
|
70
|
+
# safe: true
|
71
|
+
# options:
|
72
|
+
# *default_options
|
73
|
+
#
|
74
|
+
# development:
|
75
|
+
# sessions:
|
76
|
+
# default:
|
77
|
+
# database: activeadmin_mongoid_development
|
78
|
+
# hosts:
|
79
|
+
# - localhost:27017
|
80
|
+
# options:
|
81
|
+
# consistency: :strong
|
82
|
+
# # In the test environment we lower the retries and retry interval to
|
83
|
+
# # low amounts for fast failures.
|
84
|
+
# max_retries: 1
|
85
|
+
# retry_interval: 0
|
86
|
+
# options:
|
87
|
+
# *default_options
|
data/test_app/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,111 +1,93 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin-mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elia Schito
|
8
|
+
- Nic Boie
|
9
|
+
- JD Guzman
|
8
10
|
autorequire:
|
9
11
|
bindir: bin
|
10
12
|
cert_chain: []
|
11
|
-
date:
|
13
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
14
|
dependencies:
|
13
15
|
- !ruby/object:Gem::Dependency
|
14
16
|
name: mongoid
|
15
17
|
requirement: !ruby/object:Gem::Requirement
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - "~>"
|
18
20
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
- - <
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5.0'
|
21
|
+
version: 6.0.3
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
24
|
version_requirements: !ruby/object:Gem::Requirement
|
26
25
|
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.0'
|
30
|
-
- - <
|
26
|
+
- - "~>"
|
31
27
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
28
|
+
version: 6.0.3
|
33
29
|
- !ruby/object:Gem::Dependency
|
34
30
|
name: activeadmin
|
35
31
|
requirement: !ruby/object:Gem::Requirement
|
36
32
|
requirements:
|
37
|
-
- - ~>
|
33
|
+
- - "~>"
|
38
34
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0
|
35
|
+
version: '1.0'
|
40
36
|
type: :runtime
|
41
37
|
prerelease: false
|
42
38
|
version_requirements: !ruby/object:Gem::Requirement
|
43
39
|
requirements:
|
44
|
-
- - ~>
|
40
|
+
- - "~>"
|
45
41
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0
|
42
|
+
version: '1.0'
|
47
43
|
- !ruby/object:Gem::Dependency
|
48
44
|
name: jquery-rails
|
49
45
|
requirement: !ruby/object:Gem::Requirement
|
50
46
|
requirements:
|
51
|
-
- -
|
47
|
+
- - ">="
|
52
48
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
49
|
+
version: '0'
|
54
50
|
type: :runtime
|
55
51
|
prerelease: false
|
56
52
|
version_requirements: !ruby/object:Gem::Requirement
|
57
53
|
requirements:
|
58
|
-
- -
|
54
|
+
- - ">="
|
59
55
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
56
|
+
version: '0'
|
61
57
|
- !ruby/object:Gem::Dependency
|
62
58
|
name: sass-rails
|
63
59
|
requirement: !ruby/object:Gem::Requirement
|
64
60
|
requirements:
|
65
|
-
- -
|
61
|
+
- - ">="
|
66
62
|
- !ruby/object:Gem::Version
|
67
63
|
version: 3.1.4
|
68
|
-
- -
|
64
|
+
- - "<="
|
69
65
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
66
|
+
version: 5.0.6
|
71
67
|
type: :runtime
|
72
68
|
prerelease: false
|
73
69
|
version_requirements: !ruby/object:Gem::Requirement
|
74
70
|
requirements:
|
75
|
-
- -
|
71
|
+
- - ">="
|
76
72
|
- !ruby/object:Gem::Version
|
77
73
|
version: 3.1.4
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '5.0'
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: meta_search
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
-
requirements:
|
85
|
-
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: 1.1.3
|
88
|
-
type: :runtime
|
89
|
-
prerelease: false
|
90
|
-
version_requirements: !ruby/object:Gem::Requirement
|
91
|
-
requirements:
|
92
|
-
- - ~>
|
74
|
+
- - "<="
|
93
75
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
76
|
+
version: 5.0.6
|
95
77
|
- !ruby/object:Gem::Dependency
|
96
78
|
name: rspec-rails
|
97
79
|
requirement: !ruby/object:Gem::Requirement
|
98
80
|
requirements:
|
99
|
-
- - ~>
|
81
|
+
- - "~>"
|
100
82
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
83
|
+
version: '3.6'
|
102
84
|
type: :development
|
103
85
|
prerelease: false
|
104
86
|
version_requirements: !ruby/object:Gem::Requirement
|
105
87
|
requirements:
|
106
|
-
- - ~>
|
88
|
+
- - "~>"
|
107
89
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
90
|
+
version: '3.6'
|
109
91
|
description: ActiveAdmin hacks to support Mongoid (some ActiveAdmin features are disabled)
|
110
92
|
email:
|
111
93
|
- elia@schito.me
|
@@ -113,9 +95,10 @@ executables: []
|
|
113
95
|
extensions: []
|
114
96
|
extra_rdoc_files: []
|
115
97
|
files:
|
116
|
-
- .gitignore
|
117
|
-
- .rspec
|
118
|
-
- .travis.yml
|
98
|
+
- ".gitignore"
|
99
|
+
- ".rspec"
|
100
|
+
- ".travis.yml"
|
101
|
+
- CONDUCT.md
|
119
102
|
- Gemfile
|
120
103
|
- LICENSE
|
121
104
|
- README.md
|
@@ -130,6 +113,7 @@ files:
|
|
130
113
|
- lib/active_admin/mongoid/filter_form_builder.rb
|
131
114
|
- lib/active_admin/mongoid/generators/install.rb
|
132
115
|
- lib/active_admin/mongoid/helpers/collection.rb
|
116
|
+
- lib/active_admin/mongoid/order_clause.rb
|
133
117
|
- lib/active_admin/mongoid/resource.rb
|
134
118
|
- lib/active_admin/mongoid/version.rb
|
135
119
|
- lib/activeadmin-mongoid.rb
|
@@ -138,10 +122,13 @@ files:
|
|
138
122
|
- spec/features/smoke_spec.rb
|
139
123
|
- spec/spec_helper.rb
|
140
124
|
- spec/support/capybara.rb
|
125
|
+
- spec/support/debug.rb
|
126
|
+
- spec/support/mongoid.rb
|
141
127
|
- tasks/js.rake
|
142
128
|
- tasks/test.rake
|
143
129
|
- test_app/.gitignore
|
144
130
|
- test_app/.rspec
|
131
|
+
- test_app/Gemfile
|
145
132
|
- test_app/README.rdoc
|
146
133
|
- test_app/Rakefile
|
147
134
|
- test_app/app/admin/admin_users.rb
|
@@ -157,10 +144,11 @@ files:
|
|
157
144
|
- test_app/app/mailers/.gitkeep
|
158
145
|
- test_app/app/models/.gitkeep
|
159
146
|
- test_app/app/models/admin_user.rb
|
147
|
+
- test_app/app/models/author.rb
|
148
|
+
- test_app/app/models/city.rb
|
160
149
|
- test_app/app/models/post.rb
|
161
150
|
- test_app/app/views/layouts/application.html.erb
|
162
151
|
- test_app/config.ru
|
163
|
-
- test_app/config/_link_mongoid_config.rb
|
164
152
|
- test_app/config/application.rb
|
165
153
|
- test_app/config/boot.rb
|
166
154
|
- test_app/config/database.yml
|
@@ -171,8 +159,10 @@ files:
|
|
171
159
|
- test_app/config/initializers/active_admin.rb
|
172
160
|
- test_app/config/initializers/backtrace_silencers.rb
|
173
161
|
- test_app/config/initializers/devise.rb
|
162
|
+
- test_app/config/initializers/i18n.rb
|
174
163
|
- test_app/config/initializers/inflections.rb
|
175
164
|
- test_app/config/initializers/mime_types.rb
|
165
|
+
- test_app/config/initializers/mongoid.rb
|
176
166
|
- test_app/config/initializers/secret_token.rb
|
177
167
|
- test_app/config/initializers/session_store.rb
|
178
168
|
- test_app/config/initializers/wrap_parameters.rb
|
@@ -180,6 +170,9 @@ files:
|
|
180
170
|
- test_app/config/locales/en.yml
|
181
171
|
- test_app/config/mongoid.2.yml
|
182
172
|
- test_app/config/mongoid.3.yml
|
173
|
+
- test_app/config/mongoid.4.yml
|
174
|
+
- test_app/config/mongoid.5.yml
|
175
|
+
- test_app/config/mongoid.6.yml
|
183
176
|
- test_app/config/routes.rb
|
184
177
|
- test_app/db/migrate/20130514223107_create_admin_notes.rb
|
185
178
|
- test_app/db/migrate/20130514223108_move_admin_notes_to_comments.rb
|
@@ -215,17 +208,17 @@ require_paths:
|
|
215
208
|
- lib
|
216
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
217
210
|
requirements:
|
218
|
-
- -
|
211
|
+
- - ">="
|
219
212
|
- !ruby/object:Gem::Version
|
220
213
|
version: '0'
|
221
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
215
|
requirements:
|
223
|
-
- -
|
216
|
+
- - ">="
|
224
217
|
- !ruby/object:Gem::Version
|
225
218
|
version: '0'
|
226
219
|
requirements: []
|
227
220
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.6.11
|
229
222
|
signing_key:
|
230
223
|
specification_version: 4
|
231
224
|
summary: ActiveAdmin hacks to support Mongoid
|
@@ -233,3 +226,5 @@ test_files:
|
|
233
226
|
- spec/features/smoke_spec.rb
|
234
227
|
- spec/spec_helper.rb
|
235
228
|
- spec/support/capybara.rb
|
229
|
+
- spec/support/debug.rb
|
230
|
+
- spec/support/mongoid.rb
|