packed-model 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/packed_model/base.rb +3 -3
- data/packed-model.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.7
|
data/lib/packed_model/base.rb
CHANGED
@@ -127,7 +127,7 @@ module PackedModel
|
|
127
127
|
when :integer, :int
|
128
128
|
method_src << <<-METHOD
|
129
129
|
def #{name}=(val)
|
130
|
-
val = val.
|
130
|
+
val = val.to_i
|
131
131
|
@changed = @changed || @values[#{options[:index]}] != val
|
132
132
|
@values[#{options[:index]}] = val
|
133
133
|
end
|
@@ -136,7 +136,7 @@ module PackedModel
|
|
136
136
|
if options[:filter].is_a?(Symbol) || options[:filter].is_a?(String)
|
137
137
|
method_src << <<-METHOD
|
138
138
|
def #{name}=(val)
|
139
|
-
val = val
|
139
|
+
val = val.#{options[:filter]}
|
140
140
|
@changed = @changed || @values[#{options[:index]}] != val
|
141
141
|
@values[#{options[:index]}] = val
|
142
142
|
end
|
@@ -144,7 +144,7 @@ module PackedModel
|
|
144
144
|
elsif options[:filter] ||= block
|
145
145
|
method_src << <<-METHOD
|
146
146
|
def #{name}=(val)
|
147
|
-
val =
|
147
|
+
val = self.class.field_options(#{name.inspect})[:filter].call(val)
|
148
148
|
@changed = @changed || @values[#{options[:index]}] != val
|
149
149
|
@values[#{options[:index]}] = val
|
150
150
|
end
|
data/packed-model.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packed-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -83,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
segments:
|
85
85
|
- 0
|
86
|
-
hash:
|
86
|
+
hash: 781577043543051578
|
87
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
88
|
none: false
|
89
89
|
requirements:
|