mirror of https://github.com/rails/rails
Revert "Add nodoc to relation methods"
This reverts commit c47a698d5d
.
Reason: Let's revert pending further discussions
This commit is contained in:
parent
c47a698d5d
commit
f7562c0c35
|
@ -35,7 +35,7 @@ module ActiveRecord
|
||||||
CODE
|
CODE
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_with_value #:nodoc:
|
def create_with_value
|
||||||
@values[:create_with] || {}
|
@values[:create_with] || {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ module ActiveRecord
|
||||||
args.empty? ? self : spawn.includes!(*args)
|
args.empty? ? self : spawn.includes!(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def includes!(*args) #:nodoc:
|
def includes!(*args)
|
||||||
args.reject! {|a| a.blank? }
|
args.reject! {|a| a.blank? }
|
||||||
|
|
||||||
self.includes_values = (includes_values + args).flatten.uniq
|
self.includes_values = (includes_values + args).flatten.uniq
|
||||||
|
@ -67,7 +67,7 @@ module ActiveRecord
|
||||||
args.blank? ? self : spawn.eager_load!(*args)
|
args.blank? ? self : spawn.eager_load!(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def eager_load!(*args) #:nodoc:
|
def eager_load!(*args)
|
||||||
self.eager_load_values += args
|
self.eager_load_values += args
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -76,7 +76,7 @@ module ActiveRecord
|
||||||
args.blank? ? self : spawn.preload!(*args)
|
args.blank? ? self : spawn.preload!(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def preload!(*args) #:nodoc:
|
def preload!(*args)
|
||||||
self.preload_values += args
|
self.preload_values += args
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -93,7 +93,7 @@ module ActiveRecord
|
||||||
args.blank? ? self : spawn.references!(*args)
|
args.blank? ? self : spawn.references!(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def references!(*args) #:nodoc:
|
def references!(*args)
|
||||||
args.flatten!
|
args.flatten!
|
||||||
|
|
||||||
self.references_values = (references_values + args.map!(&:to_s)).uniq
|
self.references_values = (references_values + args.map!(&:to_s)).uniq
|
||||||
|
@ -137,7 +137,7 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def select!(value) #:nodoc:
|
def select!(value)
|
||||||
self.select_values += Array.wrap(value)
|
self.select_values += Array.wrap(value)
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -158,7 +158,7 @@ module ActiveRecord
|
||||||
args.blank? ? self : spawn.group!(*args)
|
args.blank? ? self : spawn.group!(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def group!(*args) #:nodoc:
|
def group!(*args)
|
||||||
args.flatten!
|
args.flatten!
|
||||||
|
|
||||||
self.group_values += args
|
self.group_values += args
|
||||||
|
@ -179,7 +179,7 @@ module ActiveRecord
|
||||||
args.blank? ? self : spawn.order!(*args)
|
args.blank? ? self : spawn.order!(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def order!(*args) #:nodoc:
|
def order!(*args)
|
||||||
args.flatten!
|
args.flatten!
|
||||||
|
|
||||||
references = args.reject { |arg| Arel::Node === arg }
|
references = args.reject { |arg| Arel::Node === arg }
|
||||||
|
@ -203,7 +203,7 @@ module ActiveRecord
|
||||||
args.blank? ? self : spawn.reorder!(*args)
|
args.blank? ? self : spawn.reorder!(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def reorder!(*args) #:nodoc:
|
def reorder!(*args)
|
||||||
args.flatten!
|
args.flatten!
|
||||||
|
|
||||||
self.reordering_value = true
|
self.reordering_value = true
|
||||||
|
@ -215,7 +215,7 @@ module ActiveRecord
|
||||||
args.compact.blank? ? self : spawn.joins!(*args)
|
args.compact.blank? ? self : spawn.joins!(*args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def joins!(*args) #:nodoc:
|
def joins!(*args)
|
||||||
args.flatten!
|
args.flatten!
|
||||||
|
|
||||||
self.joins_values += args
|
self.joins_values += args
|
||||||
|
@ -226,7 +226,7 @@ module ActiveRecord
|
||||||
spawn.bind!(value)
|
spawn.bind!(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def bind!(value) #:nodoc:
|
def bind!(value)
|
||||||
self.bind_values += [value]
|
self.bind_values += [value]
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -325,7 +325,9 @@ module ActiveRecord
|
||||||
opts.blank? ? self : spawn.where!(opts, *rest)
|
opts.blank? ? self : spawn.where!(opts, *rest)
|
||||||
end
|
end
|
||||||
|
|
||||||
def where!(opts, *rest) #:nodoc:
|
# #where! is identical to #where, except that instead of returning a new relation, it adds
|
||||||
|
# the condition to the existing relation.
|
||||||
|
def where!(opts, *rest)
|
||||||
references!(PredicateBuilder.references(opts)) if Hash === opts
|
references!(PredicateBuilder.references(opts)) if Hash === opts
|
||||||
|
|
||||||
self.where_values += build_where(opts, rest)
|
self.where_values += build_where(opts, rest)
|
||||||
|
@ -336,7 +338,7 @@ module ActiveRecord
|
||||||
opts.blank? ? self : spawn.having!(opts, *rest)
|
opts.blank? ? self : spawn.having!(opts, *rest)
|
||||||
end
|
end
|
||||||
|
|
||||||
def having!(opts, *rest) #:nodoc:
|
def having!(opts, *rest)
|
||||||
references!(PredicateBuilder.references(opts)) if Hash === opts
|
references!(PredicateBuilder.references(opts)) if Hash === opts
|
||||||
|
|
||||||
self.having_values += build_where(opts, rest)
|
self.having_values += build_where(opts, rest)
|
||||||
|
@ -352,7 +354,7 @@ module ActiveRecord
|
||||||
spawn.limit!(value)
|
spawn.limit!(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def limit!(value) #:nodoc:
|
def limit!(value)
|
||||||
self.limit_value = value
|
self.limit_value = value
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -368,7 +370,7 @@ module ActiveRecord
|
||||||
spawn.offset!(value)
|
spawn.offset!(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def offset!(value) #:nodoc:
|
def offset!(value)
|
||||||
self.offset_value = value
|
self.offset_value = value
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -377,7 +379,7 @@ module ActiveRecord
|
||||||
spawn.lock!(locks)
|
spawn.lock!(locks)
|
||||||
end
|
end
|
||||||
|
|
||||||
def lock!(locks = true) #:nodoc:
|
def lock!(locks = true)
|
||||||
case locks
|
case locks
|
||||||
when String, TrueClass, NilClass
|
when String, TrueClass, NilClass
|
||||||
self.lock_value = locks || true
|
self.lock_value = locks || true
|
||||||
|
@ -425,7 +427,7 @@ module ActiveRecord
|
||||||
spawn.readonly!(value)
|
spawn.readonly!(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def readonly!(value = true) #:nodoc:
|
def readonly!(value = true)
|
||||||
self.readonly_value = value
|
self.readonly_value = value
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -434,7 +436,7 @@ module ActiveRecord
|
||||||
spawn.create_with!(value)
|
spawn.create_with!(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_with!(value) #:nodoc:
|
def create_with!(value)
|
||||||
self.create_with_value = value ? create_with_value.merge(value) : {}
|
self.create_with_value = value ? create_with_value.merge(value) : {}
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -456,7 +458,7 @@ module ActiveRecord
|
||||||
spawn.from!(value, subquery_name)
|
spawn.from!(value, subquery_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def from!(value, subquery_name = nil) #:nodoc:
|
def from!(value, subquery_name = nil)
|
||||||
self.from_value = [value, subquery_name]
|
self.from_value = [value, subquery_name]
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -475,7 +477,7 @@ module ActiveRecord
|
||||||
spawn.uniq!(value)
|
spawn.uniq!(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def uniq!(value = true) #:nodoc:
|
def uniq!(value = true)
|
||||||
self.uniq_value = value
|
self.uniq_value = value
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
@ -524,7 +526,7 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def extending!(*modules, &block) #:nodoc:
|
def extending!(*modules, &block)
|
||||||
modules << Module.new(&block) if block_given?
|
modules << Module.new(&block) if block_given?
|
||||||
|
|
||||||
self.extending_values = modules.flatten
|
self.extending_values = modules.flatten
|
||||||
|
@ -540,7 +542,7 @@ module ActiveRecord
|
||||||
spawn.reverse_order!
|
spawn.reverse_order!
|
||||||
end
|
end
|
||||||
|
|
||||||
def reverse_order! #:nodoc:
|
def reverse_order!
|
||||||
self.reverse_order_value = !reverse_order_value
|
self.reverse_order_value = !reverse_order_value
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue