accessible_attributes 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -2
- data/Gemfile.lock +5 -3
- data/{README.rdoc → README.md} +20 -11
- data/Rakefile +11 -10
- data/accessible_attributes.gemspec +2 -1
- data/lib/accessible_attributes/version.rb +1 -1
- metadata +26 -11
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
accessible_attributes (0.0.
|
4
|
+
accessible_attributes (0.0.3)
|
5
5
|
rails (~> 3.0.3)
|
6
6
|
|
7
7
|
GEM
|
@@ -66,7 +66,7 @@ GEM
|
|
66
66
|
rake (>= 0.8.7)
|
67
67
|
thor (~> 0.14.4)
|
68
68
|
rake (0.8.7)
|
69
|
-
|
69
|
+
rdiscount (1.6.5)
|
70
70
|
rspec (2.3.0)
|
71
71
|
rspec-core (~> 2.3.0)
|
72
72
|
rspec-expectations (~> 2.3.0)
|
@@ -85,6 +85,7 @@ GEM
|
|
85
85
|
treetop (1.4.9)
|
86
86
|
polyglot (>= 0.3.1)
|
87
87
|
tzinfo (0.3.23)
|
88
|
+
yard (0.6.3)
|
88
89
|
|
89
90
|
PLATFORMS
|
90
91
|
ruby
|
@@ -94,7 +95,8 @@ DEPENDENCIES
|
|
94
95
|
bundler (~> 1.0.7)
|
95
96
|
rails (~> 3.0.3)
|
96
97
|
rake (~> 0.8.7)
|
97
|
-
|
98
|
+
rdiscount (~> 1.6.5)
|
98
99
|
rspec (~> 2.3.0)
|
99
100
|
rspec-rails (~> 2.3.0)
|
100
101
|
sqlite3-ruby (~> 1.3.2)
|
102
|
+
yard (~> 0.6.3)
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,19 +1,23 @@
|
|
1
|
-
|
1
|
+
# accessible_attributes
|
2
2
|
|
3
|
-
Dynamic attr_accessible for Active Record, inspired by Ryan Bates
|
4
|
-
episode 237
|
3
|
+
Dynamic attr_accessible for Active Record, inspired by Ryan Bates [Railscasts]
|
4
|
+
episode 237.
|
5
5
|
|
6
|
-
|
6
|
+
|
7
|
+
|
8
|
+
[![Click here to lend your support to: mediatags - meta-data tags as JSON and make a donation at www.pledgie.com !][2]][1]
|
9
|
+
|
10
|
+
## Installation
|
7
11
|
|
8
12
|
Add the following line to your Gemfile
|
9
13
|
gem 'accessible_attributes'
|
10
14
|
|
11
|
-
Then run
|
15
|
+
Then run bundle `install` and you're good to go
|
12
16
|
|
13
|
-
|
17
|
+
## Usage
|
14
18
|
|
15
|
-
This gem sets
|
16
|
-
|
19
|
+
This gem sets `attr_accessible` to `nil` on `ActiveRecord::Base`, requiring you to use
|
20
|
+
`attr_accessible` in all of your Active Record models to set which attributes you
|
17
21
|
want to be able to mass-assign by default.
|
18
22
|
|
19
23
|
In your controllers, to mass-assign attributes that are not enabled by default, see the following example
|
@@ -21,14 +25,14 @@ In your controllers, to mass-assign attributes that are not enabled by default,
|
|
21
25
|
@model.accessible = :my_attribute
|
22
26
|
@model.attributes = params[:model]
|
23
27
|
|
24
|
-
You can also set accessible to
|
28
|
+
You can also set `accessible` to `:all` to make all attributes available for mass-assignment
|
25
29
|
@model = Model.new
|
26
30
|
@model.accessible = :all
|
27
31
|
@model.update_attributes(params[:model])
|
28
32
|
|
29
|
-
For more information, see the
|
33
|
+
For more information, see the [Railscasts] episode or read it on [Asciicasts]
|
30
34
|
|
31
|
-
|
35
|
+
## Note on Patches/Pull Requests
|
32
36
|
|
33
37
|
* Fork the project.
|
34
38
|
* Make your feature addition or bug fix.
|
@@ -43,3 +47,8 @@ For more information, see the {Railscasts episode}[http://railscasts.com/episode
|
|
43
47
|
|
44
48
|
Copyright (c) 2010 Steven Hancock. See MIT-LICENSE for details.
|
45
49
|
|
50
|
+
|
51
|
+
[1]: http://www.pledgie.com/campaigns/14171
|
52
|
+
[2]: http://www.pledgie.com/campaigns/14171.png?skin_name=chrome
|
53
|
+
[Railscasts]: http://railscasts.com/episodes/237-dynamic-attr-accessible
|
54
|
+
[Asciicasts]: http://asciicasts.com/episodes/237-dynamic-attr-accessible
|
data/Rakefile
CHANGED
@@ -6,16 +6,17 @@ rescue LoadError
|
|
6
6
|
end
|
7
7
|
Bundler::GemHelper.install_tasks
|
8
8
|
|
9
|
-
require '
|
10
|
-
require 'rspec/core'
|
11
|
-
require 'rspec/core/rake_task'
|
9
|
+
require 'yard'
|
12
10
|
|
13
|
-
|
11
|
+
YARD::Rake::YardocTask.new (:doc) do |t|
|
12
|
+
t.files = ['README.md', 'lib/**/*.rb']
|
13
|
+
t.options = ['-o', 'doc']
|
14
|
+
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
namespace :doc do
|
17
|
+
desc 'Cleanup generated docs'
|
18
|
+
task :clean do
|
19
|
+
system "rm -Rfv doc"
|
20
|
+
system "rm -Rfv .yardoc"
|
21
|
+
end
|
21
22
|
end
|
@@ -22,7 +22,8 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency("rspec", "~> 2.3.0")
|
23
23
|
s.add_development_dependency("rspec-rails", "~> 2.3.0")
|
24
24
|
s.add_development_dependency("sqlite3-ruby", "~> 1.3.2")
|
25
|
-
s.add_development_dependency("
|
25
|
+
s.add_development_dependency("yard", "~> 0.6.3")
|
26
|
+
s.add_development_dependency("rdiscount", "~> 1.6.5")
|
26
27
|
s.add_development_dependency("rake", "~> 0.8.7")
|
27
28
|
|
28
29
|
s.files = `git ls-files`.split("\n")
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Steven Hancock
|
@@ -93,23 +93,38 @@ dependencies:
|
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: *id005
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
96
|
+
name: yard
|
97
97
|
requirement: &id006 !ruby/object:Gem::Requirement
|
98
98
|
none: false
|
99
99
|
requirements:
|
100
100
|
- - ~>
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
segments:
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
version:
|
103
|
+
- 0
|
104
|
+
- 6
|
105
|
+
- 3
|
106
|
+
version: 0.6.3
|
107
107
|
type: :development
|
108
108
|
prerelease: false
|
109
109
|
version_requirements: *id006
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
|
-
name:
|
111
|
+
name: rdiscount
|
112
112
|
requirement: &id007 !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
segments:
|
118
|
+
- 1
|
119
|
+
- 6
|
120
|
+
- 5
|
121
|
+
version: 1.6.5
|
122
|
+
type: :development
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: *id007
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rake
|
127
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
113
128
|
none: false
|
114
129
|
requirements:
|
115
130
|
- - ~>
|
@@ -121,7 +136,7 @@ dependencies:
|
|
121
136
|
version: 0.8.7
|
122
137
|
type: :development
|
123
138
|
prerelease: false
|
124
|
-
version_requirements: *
|
139
|
+
version_requirements: *id008
|
125
140
|
description: Dynamic attr_accessible for Active Record, inspired by Ryan Bates Railscasts episode 237
|
126
141
|
email:
|
127
142
|
- stevenh512@gmail.com
|
@@ -137,7 +152,7 @@ files:
|
|
137
152
|
- Gemfile
|
138
153
|
- Gemfile.lock
|
139
154
|
- MIT-LICENSE
|
140
|
-
- README.
|
155
|
+
- README.md
|
141
156
|
- Rakefile
|
142
157
|
- accessible_attributes.gemspec
|
143
158
|
- lib/accessible_attributes.rb
|
@@ -194,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
209
|
requirements:
|
195
210
|
- - ">="
|
196
211
|
- !ruby/object:Gem::Version
|
197
|
-
hash:
|
212
|
+
hash: 411341517
|
198
213
|
segments:
|
199
214
|
- 0
|
200
215
|
version: "0"
|