brightcontent-core 2.0.23 → 2.0.24
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +11 -6
- data/app/controllers/brightcontent/base_controller.rb +7 -0
- data/app/models/brightcontent/admin_user.rb +0 -1
- data/brightcontent-core.gemspec +1 -0
- data/lib/brightcontent/core.rb +2 -0
- data/lib/brightcontent/strong_params_fix.rb +16 -0
- data/spec/dummy/app/models/blog.rb +0 -1
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/config/initializers/strong_params.rb +1 -0
- metadata +22 -3
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
brightcontent-core (2.0.
|
4
|
+
brightcontent-core (2.0.24)
|
5
5
|
bcrypt-ruby
|
6
6
|
bootstrap-wysihtml5-rails
|
7
7
|
has_scope
|
@@ -9,6 +9,7 @@ PATH
|
|
9
9
|
jquery-rails
|
10
10
|
rails (~> 3.2.9)
|
11
11
|
simple_form
|
12
|
+
strong_parameters
|
12
13
|
will_paginate
|
13
14
|
|
14
15
|
GEM
|
@@ -44,7 +45,7 @@ GEM
|
|
44
45
|
addressable (2.3.2)
|
45
46
|
arel (3.0.2)
|
46
47
|
bcrypt-ruby (3.0.1)
|
47
|
-
bootstrap-wysihtml5-rails (0.3.1.
|
48
|
+
bootstrap-wysihtml5-rails (0.3.1.19)
|
48
49
|
railties (>= 3.0)
|
49
50
|
builder (3.0.4)
|
50
51
|
capybara (2.0.1)
|
@@ -71,7 +72,7 @@ GEM
|
|
71
72
|
has_scope (~> 0.5.0)
|
72
73
|
responders (~> 0.6)
|
73
74
|
journey (1.0.4)
|
74
|
-
jquery-rails (2.1
|
75
|
+
jquery-rails (2.2.1)
|
75
76
|
railties (>= 3.0, < 5.0)
|
76
77
|
thor (>= 0.14, < 2.0)
|
77
78
|
json (1.7.5)
|
@@ -132,7 +133,7 @@ GEM
|
|
132
133
|
libwebsocket (~> 0.1.3)
|
133
134
|
multi_json (~> 1.0)
|
134
135
|
rubyzip
|
135
|
-
simple_form (2.0
|
136
|
+
simple_form (2.1.0)
|
136
137
|
actionpack (~> 3.0)
|
137
138
|
activemodel (~> 3.0)
|
138
139
|
sprockets (2.2.2)
|
@@ -141,14 +142,18 @@ GEM
|
|
141
142
|
rack (~> 1.0)
|
142
143
|
tilt (~> 1.1, != 1.3.0)
|
143
144
|
sqlite3 (1.3.6)
|
145
|
+
strong_parameters (0.2.0)
|
146
|
+
actionpack (~> 3.0)
|
147
|
+
activemodel (~> 3.0)
|
148
|
+
railties (~> 3.0)
|
144
149
|
thor (0.16.0)
|
145
150
|
tilt (1.3.3)
|
146
151
|
treetop (1.4.12)
|
147
152
|
polyglot
|
148
153
|
polyglot (>= 0.3.1)
|
149
|
-
tzinfo (0.3.
|
154
|
+
tzinfo (0.3.37)
|
150
155
|
websocket (1.0.6)
|
151
|
-
will_paginate (3.0.
|
156
|
+
will_paginate (3.0.4)
|
152
157
|
xpath (1.0.0)
|
153
158
|
nokogiri (~> 1.3)
|
154
159
|
|
@@ -10,6 +10,9 @@ module Brightcontent
|
|
10
10
|
include DefaultActions
|
11
11
|
include Pagination
|
12
12
|
|
13
|
+
# Temp until inherent resources supports strong params
|
14
|
+
include StrongParamsFix
|
15
|
+
|
13
16
|
private
|
14
17
|
|
15
18
|
def list_fields
|
@@ -27,5 +30,9 @@ module Brightcontent
|
|
27
30
|
end
|
28
31
|
helper_method :default_fields
|
29
32
|
|
33
|
+
def resource_params
|
34
|
+
params.require(resource_instance_name).permit!
|
35
|
+
end
|
36
|
+
|
30
37
|
end
|
31
38
|
end
|
data/brightcontent-core.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_dependency "simple_form"
|
24
24
|
s.add_dependency "will_paginate"
|
25
25
|
s.add_dependency "bootstrap-wysihtml5-rails"
|
26
|
+
s.add_dependency "strong_parameters"
|
26
27
|
|
27
28
|
s.add_development_dependency "sqlite3"
|
28
29
|
s.add_development_dependency "rspec-rails"
|
data/lib/brightcontent/core.rb
CHANGED
@@ -4,6 +4,7 @@ require "jquery-rails"
|
|
4
4
|
require "will_paginate"
|
5
5
|
require "bootstrap-wysihtml5-rails"
|
6
6
|
require "has_scope"
|
7
|
+
require "strong_parameters"
|
7
8
|
|
8
9
|
require "brightcontent/rails/routes"
|
9
10
|
require "brightcontent/engine"
|
@@ -14,6 +15,7 @@ module Brightcontent
|
|
14
15
|
autoload :PageMethods, 'brightcontent/page_methods'
|
15
16
|
autoload :RoutesParser, 'brightcontent/routes_parser'
|
16
17
|
autoload :DefaultActions, 'brightcontent/default_actions'
|
18
|
+
autoload :StrongParamsFix, 'brightcontent/strong_params_fix'
|
17
19
|
autoload :ModelExtensions, 'brightcontent/model_extensions'
|
18
20
|
|
19
21
|
mattr_accessor :engine_resources
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Brightcontent
|
2
|
+
module StrongParamsFix
|
3
|
+
|
4
|
+
def build_resource
|
5
|
+
get_resource_ivar || set_resource_ivar(end_of_association_chain.send(method_for_build, params_for_build))
|
6
|
+
end
|
7
|
+
|
8
|
+
def params_for_build
|
9
|
+
request.get? ? {} : resource_params
|
10
|
+
end
|
11
|
+
|
12
|
+
def update_resource(object, attributes)
|
13
|
+
object.update_attributes(attributes)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -47,7 +47,7 @@ module Dummy
|
|
47
47
|
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
48
48
|
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
49
49
|
# parameters by using an attr_accessible or attr_protected declaration.
|
50
|
-
config.active_record.whitelist_attributes =
|
50
|
+
config.active_record.whitelist_attributes = false
|
51
51
|
|
52
52
|
# Enable the asset pipeline
|
53
53
|
config.assets.enabled = true
|
@@ -0,0 +1 @@
|
|
1
|
+
ActiveRecord::Base.send(:include, ActiveModel::ForbiddenAttributesProtection)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brightcontent-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.24
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -139,6 +139,22 @@ dependencies:
|
|
139
139
|
- - ! '>='
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: strong_parameters
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :runtime
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
142
158
|
- !ruby/object:Gem::Dependency
|
143
159
|
name: sqlite3
|
144
160
|
requirement: !ruby/object:Gem::Requirement
|
@@ -276,6 +292,7 @@ files:
|
|
276
292
|
- lib/brightcontent/pagination.rb
|
277
293
|
- lib/brightcontent/rails/routes.rb
|
278
294
|
- lib/brightcontent/routes_parser.rb
|
295
|
+
- lib/brightcontent/strong_params_fix.rb
|
279
296
|
- lib/generators/brightcontent/install_generator.rb
|
280
297
|
- lib/generators/brightcontent/resource_generator.rb
|
281
298
|
- lib/generators/brightcontent/templates/brightcontent_controller.rb
|
@@ -310,6 +327,7 @@ files:
|
|
310
327
|
- spec/dummy/config/initializers/mime_types.rb
|
311
328
|
- spec/dummy/config/initializers/secret_token.rb
|
312
329
|
- spec/dummy/config/initializers/session_store.rb
|
330
|
+
- spec/dummy/config/initializers/strong_params.rb
|
313
331
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
314
332
|
- spec/dummy/config/locales/en.yml
|
315
333
|
- spec/dummy/config/routes.rb
|
@@ -347,7 +365,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
347
365
|
version: '0'
|
348
366
|
segments:
|
349
367
|
- 0
|
350
|
-
hash:
|
368
|
+
hash: -2374237643085151557
|
351
369
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
352
370
|
none: false
|
353
371
|
requirements:
|
@@ -356,7 +374,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
356
374
|
version: '0'
|
357
375
|
segments:
|
358
376
|
- 0
|
359
|
-
hash:
|
377
|
+
hash: -2374237643085151557
|
360
378
|
requirements: []
|
361
379
|
rubyforge_project:
|
362
380
|
rubygems_version: 1.8.24
|
@@ -393,6 +411,7 @@ test_files:
|
|
393
411
|
- spec/dummy/config/initializers/mime_types.rb
|
394
412
|
- spec/dummy/config/initializers/secret_token.rb
|
395
413
|
- spec/dummy/config/initializers/session_store.rb
|
414
|
+
- spec/dummy/config/initializers/strong_params.rb
|
396
415
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
397
416
|
- spec/dummy/config/locales/en.yml
|
398
417
|
- spec/dummy/config/routes.rb
|