diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-26 17:00:05 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-26 17:00:05 +0300 |
commit | cb74c014ea6d27314143ffd4975717b1acee607a (patch) | |
tree | 0af860105a079095ef6302c5600bdcb69b4d7761 | |
parent | 8f60b5b4fc9c4bc5c4e727a90b6e03acbbe70d54 (diff) | |
download | gitlab-ce-cb74c014ea6d27314143ffd4975717b1acee607a.tar.gz |
Key strong params
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/controllers/profiles/keys_controller.rb | 7 | ||||
-rw-r--r-- | app/models/key.rb | 2 | ||||
-rw-r--r-- | app/models/merge_request_diff.rb | 2 | ||||
-rw-r--r-- | app/models/milestone.rb | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb index 6713cd7c8c7..88414b13564 100644 --- a/app/controllers/profiles/keys_controller.rb +++ b/app/controllers/profiles/keys_controller.rb @@ -15,7 +15,7 @@ class Profiles::KeysController < ApplicationController end def create - @key = current_user.keys.new(params[:key]) + @key = current_user.keys.new(key_params) if @key.save redirect_to profile_key_path(@key) @@ -53,4 +53,9 @@ class Profiles::KeysController < ApplicationController end end + private + + def key_params + params.require(:key).permit(:title, :key) + end end diff --git a/app/models/key.rb b/app/models/key.rb index 035c9efa016..d59993b1905 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -19,8 +19,6 @@ class Key < ActiveRecord::Base belongs_to :user - attr_accessible :key, :title - before_validation :strip_white_space, :generate_fingerpint validates :title, presence: true, length: { within: 0..255 } diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 7dce71a677b..d3c07555b0c 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -22,8 +22,6 @@ class MergeRequestDiff < ActiveRecord::Base belongs_to :merge_request - attr_accessible :state, :st_commits, :st_diffs - delegate :target_branch, :source_branch, to: :merge_request, prefix: nil state_machine :state, initial: :empty do diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 39ab0b536a3..e28de72c37f 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -16,7 +16,7 @@ class Milestone < ActiveRecord::Base include InternalId - attr_accessible :title, :description, :due_date, :state_event + #attr_accessible :title, :description, :due_date, :state_event belongs_to :project has_many :issues |