modelish 0.2.1 → 0.2.2
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/CHANGELOG.md +4 -0
- data/lib/modelish/base.rb +5 -3
- data/lib/modelish/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/lib/modelish/base.rb
CHANGED
@@ -11,23 +11,25 @@ module Modelish
|
|
11
11
|
include Validations
|
12
12
|
extend Configuration
|
13
13
|
|
14
|
-
def initialize(
|
14
|
+
def initialize(options={}, &block)
|
15
15
|
super(&block)
|
16
16
|
|
17
17
|
self.class.defaults.each_pair do |prop, value|
|
18
18
|
self[prop] = value
|
19
19
|
end
|
20
20
|
|
21
|
+
attributes = options ? options.dup : {}
|
22
|
+
|
21
23
|
attributes.delete_if do |k,v|
|
22
24
|
if self.class.translations.keys.include?(k.to_sym)
|
23
25
|
self[k]=v
|
24
26
|
true
|
25
27
|
end
|
26
|
-
end
|
28
|
+
end
|
27
29
|
|
28
30
|
attributes.each_pair do |att, value|
|
29
31
|
self[att] = value
|
30
|
-
end
|
32
|
+
end
|
31
33
|
end
|
32
34
|
|
33
35
|
|
data/lib/modelish/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modelish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Maeve Revels
|