Skip to content
Snippets Groups Projects
Verified Commit cb74c014 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Key strong params

parent 8f60b5b4
No related branches found
No related tags found
No related merge requests found
Loading
@@ -15,7 +15,7 @@ class Profiles::KeysController < ApplicationController
Loading
@@ -15,7 +15,7 @@ class Profiles::KeysController < ApplicationController
end end
   
def create def create
@key = current_user.keys.new(params[:key]) @key = current_user.keys.new(key_params)
   
if @key.save if @key.save
redirect_to profile_key_path(@key) redirect_to profile_key_path(@key)
Loading
@@ -53,4 +53,9 @@ class Profiles::KeysController < ApplicationController
Loading
@@ -53,4 +53,9 @@ class Profiles::KeysController < ApplicationController
end end
end end
   
private
def key_params
params.require(:key).permit(:title, :key)
end
end end
Loading
@@ -19,8 +19,6 @@ class Key < ActiveRecord::Base
Loading
@@ -19,8 +19,6 @@ class Key < ActiveRecord::Base
   
belongs_to :user belongs_to :user
   
attr_accessible :key, :title
before_validation :strip_white_space, :generate_fingerpint before_validation :strip_white_space, :generate_fingerpint
   
validates :title, presence: true, length: { within: 0..255 } validates :title, presence: true, length: { within: 0..255 }
Loading
Loading
Loading
@@ -22,8 +22,6 @@ class MergeRequestDiff < ActiveRecord::Base
Loading
@@ -22,8 +22,6 @@ class MergeRequestDiff < ActiveRecord::Base
   
belongs_to :merge_request belongs_to :merge_request
   
attr_accessible :state, :st_commits, :st_diffs
delegate :target_branch, :source_branch, to: :merge_request, prefix: nil delegate :target_branch, :source_branch, to: :merge_request, prefix: nil
   
state_machine :state, initial: :empty do state_machine :state, initial: :empty do
Loading
Loading
Loading
@@ -16,7 +16,7 @@
Loading
@@ -16,7 +16,7 @@
class Milestone < ActiveRecord::Base class Milestone < ActiveRecord::Base
include InternalId include InternalId
   
attr_accessible :title, :description, :due_date, :state_event #attr_accessible :title, :description, :due_date, :state_event
   
belongs_to :project belongs_to :project
has_many :issues has_many :issues
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment