composite_primary_keys 5.0.2 → 5.0.4

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/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ == 5.0.4 2012-03-23
2
+ * Update ActiveRecord::AttributeMethods#Write for Rails 3.2.2 (Travis Warlick)
3
+
4
+ == 5.0.4 2012-03-23
5
+ * Yanked
6
+
1
7
  == 5.0.2 2012-03-16
2
8
  * Use .rdoc extension on RDoc files (Elia Schito)
3
9
  * Update documentation to use self.primary_keys instead of set_primary_keys (Miguel Fonseca)
@@ -17,18 +17,22 @@ module ActiveRecord
17
17
  @attributes_cache.delete(attr_name)
18
18
  column = column_for_attribute(attr_name)
19
19
 
20
- if column || @attributes.has_key?(attr_name)
21
- @attributes[attr_name] = type_cast_attribute_for_write(column, value)
22
- else
23
- raise ActiveModel::MissingAttributeError, "can't write unknown attribute `#{attr_name}'"
20
+ unless column || @attributes.has_key?(attr_name)
21
+ ActiveSupport::Deprecation.warn(
22
+ "You're trying to create an attribute `#{attr_name}'. Writing arbitrary " \
23
+ "attributes on a model is deprecated. Please just use `attr_writer` etc."
24
+ )
24
25
  end
26
+ @attributes[attr_name] = type_cast_attribute_for_write(column, value)
25
27
  end
26
28
  end
29
+ alias_method :raw_write_attribute, :write_attribute
27
30
  end
28
31
  end
29
32
  end
30
33
 
31
34
  ActiveRecord::Base.class_eval do
35
+ alias_method :raw_write_attribute, :write_attribute
32
36
  alias :[]= :write_attribute
33
37
  public :[]=
34
38
  end
@@ -2,7 +2,7 @@ module CompositePrimaryKeys
2
2
  module VERSION
3
3
  MAJOR = 5
4
4
  MINOR = 0
5
- TINY = 2
5
+ TINY = 4
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composite_primary_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.2
4
+ version: 5.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-03-16 00:00:00.000000000 Z
13
+ date: 2012-03-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  requirements: []
199
199
  rubyforge_project: compositekeys
200
- rubygems_version: 1.8.19
200
+ rubygems_version: 1.8.21
201
201
  signing_key:
202
202
  specification_version: 3
203
203
  summary: Composite key support for ActiveRecord