Top Level Namespace
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#add_member_methods ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/install/web.rb', line 5 def add_member_methods inject_into_file "app/models/application_record.rb", after: "class ApplicationRecord < ActiveRecord::Base\n" do " def self.member_at(index)\n offset(index).limit(1).first\n end\n\n def self.member_by(attr, value)\n find_by(Hash[attr, value])\n end\n RUBY\n end\nend\n" |