lib/dir_model/model/relations.rb in dir_model-0.6.2 vs lib/dir_model/model/relations.rb in dir_model-0.7.0

- old
+ new

@@ -79,11 +79,11 @@ # @param [Symbol] relation_name the name of the relation # @param [DirModel::Import] dir_model_class class of the relation def has_one(relation_name, dir_model_class, options) relation_name = relation_name.to_sym - merge_has_one_relationship(relation_name => { dir_model_class: dir_model_class }.merge(options)) + has_one_relationship_object.merge(relation_name => { dir_model_class: dir_model_class }.merge(options)) define_method(:has_one?) do true end @@ -111,10 +111,10 @@ # @param [Hash] basically for set :foreign_key def has_many(relation_name, dir_model_class, options) raise "for now, DirModel's has_many may only be called once" if @_has_many_relationship.present? relation_name = relation_name.to_sym - merge_has_many_relationship(relation_name => { dir_model_class: dir_model_class }.merge(options)) + has_many_relationship_object.merge(relation_name => { dir_model_class: dir_model_class }.merge(options)) define_method(:has_many?) do true end