Skip to content

Commit 68982e4

Browse files
committed
Delegate getter and setter to model in a single line.
1 parent 5b99a70 commit 68982e4

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

lib/active_form/base.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ def attributes(*names)
6464
end
6565

6666
names.each do |attribute|
67-
delegate attribute, to: :model
68-
delegate "#{attribute}=", to: :model
67+
delegate attribute, "#{attribute}=", to: :model
6968
end
7069
end
7170

lib/active_form/form.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def attributes(*arguments)
4646
end
4747

4848
arguments.each do |attribute|
49-
delegate attribute, to: :model
50-
delegate "#{attribute}=", to: :model
49+
delegate attribute, "#{attribute}=", to: :model
5150
end
5251
end
5352
end

lib/active_form/form_collection.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ def update_models
1818
fetch_models
1919
end
2020

21-
22-
2321
def submit(params)
24-
#check_record_limit!(records, params)
25-
2622
params.each do |key, value|
2723
if parent.persisted?
2824
create_or_update_record(value)

0 commit comments

Comments
 (0)