Skip to content

Commit

Permalink
#lr_has_one to #lazy_has_one
Browse files Browse the repository at this point in the history
  • Loading branch information
msimonborg committed Dec 9, 2018
1 parent 572efa2 commit 94af6f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Person < LazyRecord::Base
attr_accessor :name, :age, :haircut
lr_has_many :dogs
lr_has_many :kitties, class_name: 'Cat'
lr_has_one :friend
lazy_has_one :friend
lr_accepts_nested_attributes_for :dogs, :kitties

lr_scope :new_with_dog, lambda { |opts = {}|
Expand Down
2 changes: 1 addition & 1 deletion lib/lazy_record/associations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Associations

ASSOCIATION_MODULE_NAME = :Associations

def lr_has_one(*args)
def lazy_has_one(*args)
include mod = get_or_set_mod(ASSOCIATION_MODULE_NAME)
mod.extend(Associations) unless mod.const_defined?('Associations')
mod.module_eval { add_has_one_methods(args) }
Expand Down
2 changes: 1 addition & 1 deletion spec/lazy_record/associations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe LazyRecord::Associations do
it_can_include_and_inherit 'AssociationsSpec', 'Association' do
AssociationsSpec.class_eval do
lr_has_one :association
lazy_has_one :association
end

let!(:one) { AssociationsSpec.new association: two }
Expand Down

0 comments on commit 94af6f6

Please sign in to comment.