assignable_values 0.12.0 → 0.12.1
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.
- data/Gemfile.lock +1 -1
- data/gemfiles/Gemfile.2.3.lock +1 -1
- data/gemfiles/Gemfile.3.2.lock +1 -1
- data/gemfiles/Gemfile.4.2.lock +1 -1
- data/gemfiles/Gemfile.5.0.lock +1 -1
- data/lib/assignable_values/active_record/restriction/base.rb +5 -1
- data/lib/assignable_values/version.rb +1 -1
- data/lib/assignable_values.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/gemfiles/Gemfile.2.3.lock
CHANGED
data/gemfiles/Gemfile.3.2.lock
CHANGED
data/gemfiles/Gemfile.4.2.lock
CHANGED
data/gemfiles/Gemfile.5.0.lock
CHANGED
|
@@ -164,7 +164,7 @@ module AssignableValues
|
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
def ensure_after_initialize_callback_enabled
|
|
167
|
-
if
|
|
167
|
+
if active_record_2?
|
|
168
168
|
enhance_model do
|
|
169
169
|
# Old ActiveRecord version only call after_initialize callbacks only if this method is defined in a class.
|
|
170
170
|
unless method_defined?(:after_initialize)
|
|
@@ -174,6 +174,10 @@ module AssignableValues
|
|
|
174
174
|
end
|
|
175
175
|
end
|
|
176
176
|
|
|
177
|
+
def active_record_2?
|
|
178
|
+
::ActiveRecord::VERSION::MAJOR < 3
|
|
179
|
+
end
|
|
180
|
+
|
|
177
181
|
def setup_validation
|
|
178
182
|
restriction = self
|
|
179
183
|
enhance_model do
|
data/lib/assignable_values.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'active_record'
|
|
1
2
|
require 'assignable_values/errors'
|
|
2
3
|
require 'assignable_values/active_record'
|
|
3
4
|
require 'assignable_values/active_record/restriction/base'
|
|
@@ -5,4 +6,3 @@ require 'assignable_values/active_record/restriction/belongs_to_association'
|
|
|
5
6
|
require 'assignable_values/active_record/restriction/scalar_attribute'
|
|
6
7
|
require 'assignable_values/humanized_value'
|
|
7
8
|
require 'assignable_values/humanizable_string'
|
|
8
|
-
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: assignable_values
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 45
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 12
|
|
9
|
-
-
|
|
10
|
-
version: 0.12.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.12.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Henning Koch
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2016-11-
|
|
18
|
+
date: 2016-11-14 00:00:00 Z
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
21
21
|
name: activerecord
|