modelish 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.2.2 (2012-3-8)
4
+
5
+ * Minor bug fix in Modelish::Base#initialize to prevent modification of argument hash
6
+
3
7
  ## 0.2.1 (2012-3-8)
4
8
 
5
9
  * Bug fix to make behavior predictable for translated properties when both the property
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(attributes = {}, &block)
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 if attributes
28
+ end
27
29
 
28
30
  attributes.each_pair do |att, value|
29
31
  self[att] = value
30
- end if attributes
32
+ end
31
33
  end
32
34
 
33
35
 
@@ -1,3 +1,3 @@
1
1
  module Modelish
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Maeve Revels