rails_apps_pages 0.5.2 → 0.5.3

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: 95fed9c951272c89829afabc42f64baa52f4d499
4
- data.tar.gz: 09ec1333fc85fd3c3e1e88bab8c6adbb8fb9c7df
3
+ metadata.gz: 355c6e54cc24fa1ca3ac67d8418b3159be8c9ecf
4
+ data.tar.gz: d126b7a537e04043f267f0844cab6f4a6143f194
5
5
  SHA512:
6
- metadata.gz: 5cdb2bec581480cebe988b742c4aa02a5a45d6847741f1a59b11557ee494e55ab4079fed36f862b5a5535105d322be92607f4232aa01914a7ba5dbbfb57ec591
7
- data.tar.gz: 4072b801b6be910f9ab74eaffde430b1b11408223934e287a54f48b9ca40f87941940e3fdc36a282a62da8c68aa25a8591461e3fe7e480f03c0d3f306606edb1
6
+ metadata.gz: af1865e41d201f1e12f931bd16be87dcbd085339c02530ce6e8052b6aba9a8a4e990f74e1bc8468eb7b79ed142860993e4f1a5327c81c5585c59afda2d2b7094
7
+ data.tar.gz: 2b816bf99d2c4612675ee57975403beb431b2247a5eb6321e3df7d0d88be5d0e055c27427b244ef0dd294d532b0116986cc91a0a58f235a82e3fb886f4752d52
data/CHANGELOG.textile CHANGED
@@ -1,5 +1,9 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h3. 0.5.3 June 17, 2014
4
+
5
+ * Devise permitted parameters moved to 'config/initializers/devise_permitted_parameters.rb'
6
+
3
7
  h3. 0.5.2 June 14, 2014
4
8
 
5
9
  * updated policy for Pundit example
@@ -0,0 +1,17 @@
1
+ module DevisePermittedParameters
2
+ extend ActiveSupport::Concern
3
+
4
+ included do
5
+ before_filter :configure_permitted_parameters
6
+ end
7
+
8
+ protected
9
+
10
+ def configure_permitted_parameters
11
+ devise_parameter_sanitizer.for(:sign_up) << :name
12
+ devise_parameter_sanitizer.for(:account_update) << :name
13
+ end
14
+
15
+ end
16
+
17
+ DeviseController.send :include, DevisePermittedParameters
@@ -36,8 +36,7 @@ module Pages
36
36
  return unless File.exists?('config/initializers/devise.rb')
37
37
  if Object.const_defined?('User')
38
38
  if User.column_names.include? 'name'
39
- permitted = File.read(find_in_source_paths('devise/permitted_parameters.rb'))
40
- inject_into_file 'app/controllers/application_controller.rb', permitted + "\n", :after => "protect_from_forgery with: :exception\n"
39
+ copy_file 'devise/devise_permitted_parameters.rb', 'config/initializers/devise_permitted_parameters.rb'
41
40
  prepend_file 'app/views/users/_user.html.erb', "<td><%= link_to user.name, user %></td>\n"
42
41
  inject_into_file 'app/views/users/show.html.erb', "\n<p>Name: <%= @user.name if @user.name %></p>", :before => "\n<p>Email"
43
42
  end
@@ -1,3 +1,3 @@
1
1
  module RailsAppsPages
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_apps_pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Kehoe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-15 00:00:00.000000000 Z
11
+ date: 2014-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,7 +67,7 @@ files:
67
67
  - lib/generators/pages/home/templates/home_page_spec.rb
68
68
  - lib/generators/pages/home/templates/index.html.erb
69
69
  - lib/generators/pages/home/templates/visitors_controller.rb
70
- - lib/generators/pages/users/templates/devise/permitted_parameters.rb
70
+ - lib/generators/pages/users/templates/devise/devise_permitted_parameters.rb
71
71
  - lib/generators/pages/users/templates/devise/users_controller.rb
72
72
  - lib/generators/pages/users/templates/omniauth/users_controller.rb
73
73
  - lib/generators/pages/users/templates/users/_user.html.erb
@@ -1,8 +0,0 @@
1
- before_action :configure_permitted_parameters, if: :devise_controller?
2
-
3
- protected
4
-
5
- def configure_permitted_parameters
6
- devise_parameter_sanitizer.for(:sign_up) << :name
7
- devise_parameter_sanitizer.for(:account_update) << :name
8
- end