Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename internals to be consistent with the published name; parental_c…

…ontrol, not self_control.
  • Loading branch information...
commit aa975b2a10b18dd8bc9402142c2e83acf4222401 1 parent c809562
@h-lame h-lame authored
Showing with 27 additions and 27 deletions.
  1. +27 −27 lib/parental_control.rb
View
54 lib/parental_control.rb
@@ -79,26 +79,26 @@ module AssociationCollectionMethods
module BelongsToAssociationMethods
def self.included(base)
base.class_eval do
- def create_with_self_control(attributes = {})
- record = create_without_self_control(attributes)
+ def create_with_parental_control(attributes = {})
+ record = create_without_parental_control(attributes)
set_reciprocal_instance(record, @owner)
record
end
- alias_method_chain :create, :self_control
+ alias_method_chain :create, :parental_control
- def build_with_self_control(attributes = {})
- record = build_without_self_control(attributes)
+ def build_with_parental_control(attributes = {})
+ record = build_without_parental_control(attributes)
set_reciprocal_instance(record, @owner)
record
end
- alias_method_chain :build, :self_control
+ alias_method_chain :build, :parental_control
- def find_target_with_self_control
- record = find_target_without_self_control
+ def find_target_with_parental_control
+ record = find_target_without_parental_control
set_reciprocal_instance(record, @owner)
record
end
- alias_method_chain :find_target, :self_control
+ alias_method_chain :find_target, :parental_control
end
end
end
@@ -106,26 +106,26 @@ def find_target_with_self_control
module HasOneAssociationMethods
def self.included(base)
base.class_eval do
- def create_with_self_control(attributes = {}, replace_existing = true)
- record = create_without_self_control(attributes, replace_existing)
+ def create_with_parental_control(attributes = {}, replace_existing = true)
+ record = create_without_parental_control(attributes, replace_existing)
set_reciprocal_instance(record, @owner)
record
end
- alias_method_chain :create, :self_control
+ alias_method_chain :create, :parental_control
- def build_with_self_control(attributes = {}, replace_existing = true)
- record = build_without_self_control(attributes, replace_existing)
+ def build_with_parental_control(attributes = {}, replace_existing = true)
+ record = build_without_parental_control(attributes, replace_existing)
set_reciprocal_instance(record, @owner)
record
end
- alias_method_chain :build, :self_control
+ alias_method_chain :build, :parental_control
- def find_target_with_self_control
- record = find_target_without_self_control
+ def find_target_with_parental_control
+ record = find_target_without_parental_control
set_reciprocal_instance(record, @owner)
record
end
- alias_method_chain :find_target, :self_control
+ alias_method_chain :find_target, :parental_control
end
end
end
@@ -133,28 +133,28 @@ def find_target_with_self_control
module HasManyAssociationMethods
def self.included(base)
base.class_eval do
- def create_with_self_control(attributes = {}, &block)
- record = create_without_self_control(attributes, &block)
+ def create_with_parental_control(attributes = {}, &block)
+ record = create_without_parental_control(attributes, &block)
set_reciprocal_instance(record, @owner)
record
end
- alias_method_chain :create, :self_control
+ alias_method_chain :create, :parental_control
- def build_with_self_control(attributes = {}, &block)
- record = build_without_self_control(attributes, &block)
+ def build_with_parental_control(attributes = {}, &block)
+ record = build_without_parental_control(attributes, &block)
set_reciprocal_instance(record, @owner)
record
end
- alias_method_chain :build, :self_control
+ alias_method_chain :build, :parental_control
- def find_target_with_self_control
- records = find_target_without_self_control
+ def find_target_with_parental_control
+ records = find_target_without_parental_control
records.each do |record|
set_reciprocal_instance(record, @owner)
end
records
end
- alias_method_chain :find_target, :self_control
+ alias_method_chain :find_target, :parental_control
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.