Skip to content

Commit

Permalink
tweaks. related to issue #288
Browse files Browse the repository at this point in the history
  • Loading branch information
manxingxing committed Jul 18, 2013
1 parent d69dfd6 commit 916388f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions app/controllers/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ def show
end

def update
if @user.update_attributes(params[:user].slice(:login, :password, :password_confirmation, :firstname,
:middlenames, :lastname, :email, :salutation, :institution_name, :institution_url, :institution_phone,
:institution_fax, :url, :country, :city, :street, :comment, :avatar, :receive_emails))
if @user.update_attributes(user_params)
redirect_to profile_path, :notice => "Saved successfully"
else
render :edit
Expand Down Expand Up @@ -51,4 +49,11 @@ def votes_history
def load_current_user
@user = current_user
end

def user_params
params[:user].slice(:login, :password, :password_confirmation, :firstname,
:middlenames, :lastname, :email, :salutation, :institution_name,
:institution_url, :institution_phone, :institution_fax, :url, :country,
:city, :street, :comment, :avatar, :receive_emails)
end
end
4 changes: 2 additions & 2 deletions app/models/datacolumn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ def untouched?

def split_me?
# This method returns true for a column when it requires splitting.
return false if self.approval_stage < 2
return false unless datagroup_approved && datatype_approved
return false if %w{category text}.include? self.import_data_type
self.sheetcells.where(["category_id is not null and exists(select 1 from categories AS c where c.datagroup_id = ? and c.id = sheetcells.category_id)", self.datagroup_id]).exists?
self.sheetcells.where("category_id is not null").exists?
end

# users of a datacolumn are those who are responsible for it
Expand Down
2 changes: 1 addition & 1 deletion app/views/datasets/approval_quick.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%th Datagroup
%th Datatype
%tbody
-@dataset.datacolumns.each do |c|
-@dataset.datacolumns.includes(:datagroup).each do |c|
= hidden_field_tag "datacolumn[][id]", c.id
%tr
%td= c.columnnr
Expand Down

0 comments on commit 916388f

Please sign in to comment.