lib/iron_bank/associations.rb in iron_bank-2.2.0 vs lib/iron_bank/associations.rb in iron_bank-3.0.0
- old
+ new
@@ -10,11 +10,11 @@
def with_one(name, options = {})
resource_name = options.fetch(
:resource_name,
IronBank::Utils.camelize(name)
)
- foreign_key = options.fetch(:foreign_key, name.to_s + '_id')
+ foreign_key = options.fetch(:foreign_key, name.to_s + "_id")
define_method(name) do
return unless (foreign_key_value = public_send(foreign_key))
with_memoization(name) do
@@ -35,10 +35,10 @@
IronBank::Utils.camelize(name.to_s.chop)
)
foreign_key = options.fetch(
:foreign_key,
- IronBank::Utils.underscore(object_name) + '_id'
+ IronBank::Utils.underscore(object_name) + "_id"
)
define_method(name) do
with_memoization(name) do
# NOTE: we retrieve the constant here to prevent the need to order