protected_attributes 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53459972482aff7a63f624080970d9db3289056a
4
- data.tar.gz: e28892b6cc894a1f88c28702748ef7a8f3a1eaea
3
+ metadata.gz: 2ce4f8f51e6f3db2f77a83f05ac9f8324f66e241
4
+ data.tar.gz: 9b2fc7832f70e8a406c1fef5c0ef5a60f326a38a
5
5
  SHA512:
6
- metadata.gz: 45e13d7c92b6a029ea984c455d25c8edee1283fa6717fe23985e9fc5123859dc33907d66e0c4e124e6a4d9f7c2090f3f95d858693fb3da705b8741aa4b5a90f0
7
- data.tar.gz: e2ce848b56b7033831d17351d15cd268134d00852ac2b9b5ae47d2bb8903a350c1e71c7163f74bb96eadef5b5ce54c1ea389a8bd472c1e8df612e59f098ddb57
6
+ metadata.gz: ac6bc021dc2e68161e8a7a774ba7f498a0b2d3e218cf456ba2d3b191723714a06eccbb74a8e7832bf81202f3f8f4443db4f78bd83814e34ca15be2e75b45925c
7
+ data.tar.gz: e5b6680fb9e5c887fee649f73f6e6bb824ef11d9739f8c648c34e949d303fb54ceea92c4373472f1144fea7529b6c314115069729c670d2559ec7b218085637c
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Guillermo Iguaran
1
+ Copyright (c) 2012-2017 Guillermo Iguaran
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -38,7 +38,7 @@ attr_accessible :name
38
38
  attr_accessible :name, :is_admin, :as => :admin
39
39
  ```
40
40
 
41
- If you want to set a protected attribute, you will to have to assign it individually:
41
+ If you want to set a protected attribute, you will have to assign it individually:
42
42
 
43
43
  ```ruby
44
44
  params[:user] # => {:name => "owned", :is_admin => true}
@@ -15,7 +15,11 @@ module ActiveRecord
15
15
 
16
16
  attr_names.each do |association_name|
17
17
  if reflection = reflect_on_association(association_name)
18
- reflection.options[:autosave] = true
18
+ if active_record_40?
19
+ reflection.options[:autosave] = true
20
+ else
21
+ reflection.autosave = true
22
+ end
19
23
  add_autosave_association_callbacks(reflection)
20
24
 
21
25
  nested_attributes_options = self.nested_attributes_options.dup
@@ -87,7 +91,7 @@ module ActiveRecord
87
91
  end
88
92
 
89
93
  if limit && attributes_collection.size > limit
90
- raise TooManyRecords, "Maximum #{limit} records are allowed. Got #{attributes_collection.size} records instead."
94
+ raise ::ActiveRecord::NestedAttributes::TooManyRecords, "Maximum #{limit} records are allowed. Got #{attributes_collection.size} records instead."
91
95
  end
92
96
  end
93
97
 
@@ -1,3 +1,3 @@
1
1
  module ProtectedAttributes
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protected_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2017-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  requirements: []
166
166
  rubyforge_project:
167
- rubygems_version: 2.4.7
167
+ rubygems_version: 2.5.2
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: Protect attributes from mass assignment in Active Record models