Skip to content

Commit

Permalink
Delegate getter and setter to model in a single line.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Aug 21, 2014
1 parent 5b99a70 commit 68982e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions lib/active_form/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def attributes(*names)
end

names.each do |attribute|
delegate attribute, to: :model
delegate "#{attribute}=", to: :model
delegate attribute, "#{attribute}=", to: :model
end
end

Expand Down
3 changes: 1 addition & 2 deletions lib/active_form/form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ def attributes(*arguments)
end

arguments.each do |attribute|
delegate attribute, to: :model
delegate "#{attribute}=", to: :model
delegate attribute, "#{attribute}=", to: :model
end
end
end
Expand Down
4 changes: 0 additions & 4 deletions lib/active_form/form_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ def update_models
fetch_models
end



def submit(params)
#check_record_limit!(records, params)

params.each do |key, value|
if parent.persisted?
create_or_update_record(value)
Expand Down

0 comments on commit 68982e4

Please sign in to comment.