lib/dependent_restrict.rb in dependent_restrict-0.1.0 vs lib/dependent_restrict.rb in dependent_restrict-0.1.1
- old
+ new
@@ -1,10 +1,10 @@
require 'active_record'
require 'dependent_restrict/delete_restriction_error'
module DependentRestrict
- VERSION = '0.1.0'
+ VERSION = '0.1.1'
def self.included(base)
super
base.extend(ClassMethods)
@@ -22,15 +22,15 @@
# is private so we can't. We alias has_many instead trying to be as fair
# as we can to the original behaviour.
def has_one_with_restrict(*args) #:nodoc:
reflection = if active_record_4?
association_id, options, scope, extension = *args
- create_reflection(:has_one, association_id, options, scope ||= {}, self)
+ create_reflection(:has_one, association_id, options || {}, scope || {}, self)
else
association_id, options, extension = *args
- create_reflection(:has_one, association_id, options, self)
+ create_reflection(:has_one, association_id, options || {}, self)
end
- add_dependency_callback!(reflection, options)
+ add_dependency_callback!(reflection, options || {})
has_one_without_restrict(*args) #association_id, options, &extension)
end
def has_many_with_restrict(association_id, options = {}, &extension) #:nodoc:
reflection = if active_record_4?