let_me_mass_assign_protected_attributes 0.0.1 → 0.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/Readme.md CHANGED
@@ -40,7 +40,7 @@ and these class methods:
40
40
  * `unprotected_new`
41
41
  * `unprotected_create`/`unprotected_create!`
42
42
 
43
- Thank you, Active Record, for always protecting me when I want you to. But sometimes I don't. Don't protect me for a second while I sneak in and change some protected attributes...
43
+ Thank you, Active Record, for always protecting me from doing stupid things. But sometimes I *want* to have unprotected mass-assigns, so stop protecting me for just a second while I intentionally change some protected attributes...
44
44
 
45
45
  More examples:
46
46
 
@@ -78,6 +78,8 @@ Further reading
78
78
  To do
79
79
  =====
80
80
 
81
+ * invitation.unprotected_build_membership(role: 'leader')
82
+ * Allow passing a block like you can with normal new/create
81
83
  * Add tests
82
84
 
83
85
  Contributing
@@ -33,7 +33,7 @@ module LetMeMassAssignProtectedAttributes
33
33
  if attributes.is_a?(Array)
34
34
  attributes.each {|attributes| unprotected_new(attributes) }
35
35
  else
36
- self.unprotected_attributes = attributes
36
+ new.tap {|_| _.unprotected_attributes = attributes }
37
37
  end
38
38
  end
39
39
 
@@ -1,3 +1,3 @@
1
1
  module LetMeMassAssignProtectedAttributes
2
- Version = "0.0.1"
2
+ Version = "0.0.2"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: let_me_mass_assign_protected_attributes
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tyler Rick
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-09-08 00:00:00 -07:00
13
+ date: 2011-09-13 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies: []
16
16