static_model 1.0.1 → 1.0.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/lib/static_model/base.rb +3 -3
- data/lib/static_model.rb +1 -1
- data/static_model.gemspec +1 -1
- metadata +3 -3
data/lib/static_model/base.rb
CHANGED
@@ -56,7 +56,7 @@ module StaticModel
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def attributes
|
59
|
-
@attributes ||=
|
59
|
+
@attributes ||= {}
|
60
60
|
end
|
61
61
|
|
62
62
|
def attributes=(attribute_hash)
|
@@ -132,7 +132,7 @@ module StaticModel
|
|
132
132
|
records = []
|
133
133
|
if data.is_a?(Hash) && data.has_key?('records')
|
134
134
|
records = data.delete('records')
|
135
|
-
@class_attributes =
|
135
|
+
@class_attributes = data
|
136
136
|
@class_attributes.make_indifferent! if @class_attributes.respond_to?(:make_indifferent!)
|
137
137
|
elsif data.is_a?(Array)
|
138
138
|
records = data
|
@@ -213,7 +213,7 @@ module StaticModel
|
|
213
213
|
|
214
214
|
protected
|
215
215
|
def set_attribute(name, value)
|
216
|
-
self.attributes[name] = value
|
216
|
+
self.attributes[name.to_s] = value
|
217
217
|
end
|
218
218
|
|
219
219
|
def get_attribute(name)
|
data/lib/static_model.rb
CHANGED
data/static_model.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: Shoulda
|
17
|
-
requirement: &
|
17
|
+
requirement: &2152683560 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 1.2.0
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2152683560
|
26
26
|
description: StaticModel provides a Base class much like ActiveRecord which supports
|
27
27
|
reading from a YAML file and basic associations to ActiveRecord
|
28
28
|
email: aaron@quirkey.com
|