lib/rom/sql/relation/class_methods.rb in rom-sql-0.4.0.beta1 vs lib/rom/sql/relation/class_methods.rb in rom-sql-0.4.0.beta2
- old
+ new
@@ -20,10 +20,11 @@
def many_to_many(name, options = {})
associations << [__method__, name, options.merge(relation: name)]
end
def many_to_one(name, options = {})
- new_options = options.merge(relation: Inflector.pluralize(name).to_sym)
+ relation_name = Inflector.pluralize(name).to_sym
+ new_options = options.merge(relation: relation_name)
associations << [__method__, name, new_options]
end
def finalize(relations, relation)
model.set_dataset(relation.dataset)