dm_preferences 1.5 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -4
- data/app/models/preference.rb +7 -2
- data/lib/preferences/version.rb +1 -1
- metadata +30 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9aa6bbd4e3efa52972364fd59b785f0dbb93be9
|
4
|
+
data.tar.gz: 03ec4bdc0aa0773e696a9258eff0b09e024d6995
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 193a69208ec790f77ae4405212ad4cdf88b0d93948e8c6655075f13796c28ef29ba4122a2b7d604bdb9d0dc0b2f5e7f4a208abd19b7747917761fd091f080985
|
7
|
+
data.tar.gz: 1d75b2dc1642433a1e4fc3e40c308f77c1fb30013806ddc353a527eb436347607e0391e50ad31f3cf2b8ba4267a97cf67b8d906a60387a10213b89d64fc989a0
|
data/.travis.yml
CHANGED
data/app/models/preference.rb
CHANGED
@@ -8,8 +8,13 @@
|
|
8
8
|
# +owner+ is the User record, the +name+ is "color", and the +group+ is the
|
9
9
|
# Car record. This allows preferences to have a sort of context around them.
|
10
10
|
class Preference < ActiveRecord::Base
|
11
|
-
|
12
|
-
|
11
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
12
|
+
belongs_to :owner, :polymorphic => true, :optional => true
|
13
|
+
belongs_to :group, :polymorphic => true, :optional => true
|
14
|
+
else
|
15
|
+
belongs_to :owner, :polymorphic => true
|
16
|
+
belongs_to :group, :polymorphic => true
|
17
|
+
end
|
13
18
|
|
14
19
|
validates_presence_of :name, :owner_id, :owner_type
|
15
20
|
validates_presence_of :group_type, :if => :group_id?
|
data/lib/preferences/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm_preferences
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Walker
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -129,48 +129,48 @@ signing_key:
|
|
129
129
|
specification_version: 4
|
130
130
|
summary: Custom preferences for ActiveRecord models
|
131
131
|
test_files:
|
132
|
-
- spec/
|
133
|
-
- spec/
|
132
|
+
- spec/spec_helper.rb
|
133
|
+
- spec/unit/preference_spec.rb
|
134
|
+
- spec/unit/preference_definition_spec.rb
|
134
135
|
- spec/dummy/app/models/manager.rb
|
136
|
+
- spec/dummy/app/models/employee.rb
|
137
|
+
- spec/dummy/app/models/car.rb
|
135
138
|
- spec/dummy/app/models/user.rb
|
136
|
-
- spec/dummy/bin/bundle
|
137
|
-
- spec/dummy/bin/rails
|
138
139
|
- spec/dummy/bin/rake
|
139
140
|
- spec/dummy/bin/setup
|
140
|
-
- spec/dummy/
|
141
|
-
- spec/dummy/
|
142
|
-
- spec/dummy/config/
|
143
|
-
- spec/dummy/config/
|
144
|
-
- spec/dummy/config/
|
141
|
+
- spec/dummy/bin/bundle
|
142
|
+
- spec/dummy/bin/rails
|
143
|
+
- spec/dummy/config/secrets.yml
|
144
|
+
- spec/dummy/config/routes.rb
|
145
|
+
- spec/dummy/config/locales/en.yml
|
145
146
|
- spec/dummy/config/environments/production.rb
|
147
|
+
- spec/dummy/config/environments/development.rb
|
146
148
|
- spec/dummy/config/environments/test.rb
|
147
|
-
- spec/dummy/config/
|
149
|
+
- spec/dummy/config/environment.rb
|
150
|
+
- spec/dummy/config/application.rb
|
151
|
+
- spec/dummy/config/database.yml
|
152
|
+
- spec/dummy/config/boot.rb
|
148
153
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
149
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
150
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
151
|
-
- spec/dummy/config/initializers/inflections.rb
|
152
154
|
- spec/dummy/config/initializers/mime_types.rb
|
155
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
153
156
|
- spec/dummy/config/initializers/session_store.rb
|
154
157
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
155
|
-
- spec/dummy/config/
|
156
|
-
- spec/dummy/config/
|
157
|
-
- spec/dummy/config/
|
158
|
+
- spec/dummy/config/initializers/assets.rb
|
159
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
160
|
+
- spec/dummy/config/initializers/inflections.rb
|
158
161
|
- spec/dummy/config.ru
|
159
|
-
- spec/dummy/
|
160
|
-
- spec/dummy/db/migrate/002_create_cars.rb
|
161
|
-
- spec/dummy/db/migrate/003_create_employees.rb
|
162
|
-
- spec/dummy/db/migrate/004_create_preferences.rb
|
162
|
+
- spec/dummy/Rakefile
|
163
163
|
- spec/dummy/db/schema.rb
|
164
164
|
- spec/dummy/db/test.sqlite3
|
165
|
-
- spec/dummy/
|
165
|
+
- spec/dummy/db/migrate/002_create_cars.rb
|
166
|
+
- spec/dummy/db/migrate/004_create_preferences.rb
|
167
|
+
- spec/dummy/db/migrate/003_create_employees.rb
|
168
|
+
- spec/dummy/db/migrate/001_create_users.rb
|
166
169
|
- spec/dummy/log/test.log
|
167
|
-
- spec/dummy/
|
168
|
-
- spec/
|
169
|
-
- spec/factories/employee_factory.rb
|
170
|
+
- spec/dummy/log/development.log
|
171
|
+
- spec/support/assert_queries.rb
|
170
172
|
- spec/factories/preference_factory.rb
|
173
|
+
- spec/factories/employee_factory.rb
|
174
|
+
- spec/factories/car_factory.rb
|
171
175
|
- spec/factories/users_factory.rb
|
172
176
|
- spec/functional/preferences_spec.rb
|
173
|
-
- spec/spec_helper.rb
|
174
|
-
- spec/support/assert_queries.rb
|
175
|
-
- spec/unit/preference_definition_spec.rb
|
176
|
-
- spec/unit/preference_spec.rb
|