Skip to content

Commit

Permalink
Change indentation when inserting into models
Browse files Browse the repository at this point in the history
  • Loading branch information
jho406 committed Jan 3, 2025
1 parent a553322 commit c1e1709
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ def copy_js_files
def add_member_methods
inject_into_file "app/models/application_record.rb", after: "class ApplicationRecord < ActiveRecord::Base\n" do
<<-RUBY
# This enables digging by index when used with props_template
# see https://thoughtbot.github.io/superglue/digging/#index-based-selection
def self.member_at(index)
offset(index).limit(1).first
end
# This enables digging by index when used with props_template
# see https://thoughtbot.github.io/superglue/digging/#index-based-selection
def self.member_at(index)
offset(index).limit(1).first
end
# This enables digging by attribute when used with props_template
# see https://thoughtbot.github.io/superglue/digging/#attribute-based-selection
def self.member_by(attr, value)
find_by(Hash[attr, value])
end
# This enables digging by attribute when used with props_template
# see https://thoughtbot.github.io/superglue/digging/#attribute-based-selection
def self.member_by(attr, value)
find_by(Hash[attr, value])
end
RUBY
end
end
Expand Down

0 comments on commit c1e1709

Please sign in to comment.