static_model 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -56,7 +56,7 @@ module StaticModel
56
56
  end
57
57
 
58
58
  def attributes
59
- @attributes ||= Hash.new
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 = Hash.new(data)
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
@@ -5,7 +5,7 @@ require 'yaml' unless defined?(YAML)
5
5
  require 'erb' unless defined?(ERB)
6
6
 
7
7
  module StaticModel
8
- VERSION = '1.0.1'
8
+ VERSION = '1.0.2'
9
9
  end
10
10
 
11
11
  require 'static_model/active_support'
data/static_model.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{static_model}
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron Quint"]
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.1
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: &2156263560 !ruby/object:Gem::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: *2156263560
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