Dmitry Polushkin
04e3b41e2f
Add a note to the changelog for #9499
2013-10-13 21:54:07 +01:00
Dmitry Polushkin
3a6cf83b9a
add inversed accessor to association class
2013-10-13 21:51:40 +01:00
Dmitry Polushkin
05b178085a
inversed instance should not be reloaded after stale state was changed
...
check at association reader that record is inverted and should not be reloaded because of stale was changed at target record
2013-10-13 21:51:40 +01:00
Rafael Mendonça França
dcff027a52
Merge pull request #12518 from vipulnsward/remove_count_options
...
`Relation#count` doesn't use options anymore.
2013-10-13 12:56:47 -07:00
Rafael Mendonça França
3a2093984f
Add nodoc to method
2013-10-13 16:54:04 -03:00
Rafael Mendonça França
95cb54a29e
Merge pull request #12508 from jetthoughts/12415_generate_subqueries_for_relation_from_binding_params
...
Generate subquery for Relation passed as array condition for where
Conflicts:
activerecord/CHANGELOG.md
2013-10-13 16:45:30 -03:00
Paul Nikitochkin
bc293ff690
Generate subquery for Relation passed as array condition for where
...
Instead of executing 2 queries for fetching records filtered by array condition with Relation,
added generation of subquery to current query.
This behaviour will be consistent when passes Relation as hash condition to where
Closes : #12415
2013-10-13 22:13:50 +03:00
Rafael Mendonça França
0b2884a8ae
Merge pull request #12456 from razielgn/ar-test-fixes
...
Fixed MRI dependent stuff in AR tests
2013-10-13 12:09:12 -07:00
Rafael Mendonça França
c56dc753b4
Merge pull request #12511 from jetthoughts/informative_raise_message_for_incorrect_association
...
Make missed association exception message more informative
2013-10-13 12:01:27 -07:00
Paul Nikitochkin
625cd69a8b
Make missed association exception message more informative
...
Add target class name, which should have missed association on preload,
into exception message to simplify detecting problem part.
2013-10-13 21:56:44 +03:00
Vipul A M
42d3d3c217
Stop accepting options
for Relation#average
, Relation#minimum
, Relation#maximum
, Relation#calculate
, perform_calculation
, NullRelation#calculate
as they isn't used anymore.
2013-10-14 00:04:10 +05:30
Vipul A M
4ce643dbb5
Relation#count
doesn't use options anymore.
2013-10-13 21:27:21 +05:30
Vipul A M
73ec210e4c
Drop unused iterator var
2013-10-13 20:54:09 +05:30
Rafael Mendonça França
0df9149fd6
Merge pull request #11791 from versioncontrol/includes_with_persistent_select
...
Includes with persistent select, fixes #11773
2013-10-12 21:17:26 -07:00
Aaron Patterson
cc362fe17b
no reason to do this column addition and subtraction business
2013-10-11 11:06:58 -07:00
Aaron Patterson
34c3c64ecc
refactor a little so we can remove some methods
2013-10-10 16:00:07 -07:00
Aaron Patterson
6537e5044c
the parent node is on the stack, so use it
...
we don't need to walk back up the node's parents when we have the parent
on the stack
2013-10-10 14:59:36 -07:00
Aaron Patterson
c4d0e69ad2
pass the parent node to the construct method
2013-10-10 14:57:45 -07:00
Aaron Patterson
0c6c026dec
nodes do not need to be sorted
2013-10-10 14:53:50 -07:00
Aaron Patterson
ff5f328bdf
delete unused code
...
Now that we merge trees from the top down, we don't need to search
through the whole tree for particular nodes, just walk it and merge.
2013-10-10 14:50:12 -07:00
Aaron Patterson
223082e588
merge JoinDependency as outer joins
...
Merge JoinDependency objects as outer joins
2013-10-10 14:46:15 -07:00
Aaron Patterson
d20ccb7e63
stuff the join dependency object in the "anything goes" hash.
2013-10-10 14:12:04 -07:00
Aaron Patterson
e4ec9ce78d
stop splatting things back and forth
2013-10-10 10:11:18 -07:00
Aaron Patterson
82d81bbfcb
simplify each method.
...
Stop writing terrible code Aaron. This is Ruby, not Scheme
2013-10-10 10:09:15 -07:00
Aaron Patterson
0061c5e1ef
stop creating a bunch of relation objects when we can slap all the joins on at once
2013-10-09 17:47:09 -07:00
Rafael Mendonça França
ebe9cd8e61
Merge branch 'builder-instances'
2013-10-09 20:59:45 -03:00
Rafael Mendonça França
2a10a1efed
Method visibility will not make difference here
2013-10-09 20:59:15 -03:00
Rafael Mendonça França
d0163e99d9
Remove builder instances
...
All the job can be done at class level so we can avoid some object
allocation
2013-10-09 20:56:05 -03:00
Rafael Mendonça França
c1cd342456
Extract the scope building to a class method
2013-10-09 20:48:28 -03:00
Rafael Mendonça França
1a30b1ed40
Remove unneeded reader
2013-10-09 20:27:52 -03:00
Rafael Mendonça França
19c3677882
Move wrap_scope to class level
2013-10-09 20:21:38 -03:00
Rafael Mendonça França
a929d78d7b
Move macro to class level
2013-10-09 20:17:59 -03:00
Rafael Mendonça França
3c27b6ee7e
Make validate_options a class method
2013-10-09 20:15:00 -03:00
Rafael Mendonça França
b83f3645c0
Make valid_options a class method
2013-10-09 20:10:21 -03:00
Aaron Patterson
729d3c0599
no need to to_sym
2013-10-09 16:09:59 -07:00
Aaron Patterson
b64d64a648
Merge branch 'tree'
...
* tree: (22 commits)
remove dead code
add some convenient methods for avoiding array allocations
hide join_constraints inside the JoinDependency object
speed up match?
expose the root node and call it
just skip the join if it's already there
speed up finding existing nodes
make node search more efficient
remove == so we can see where walking up parents occurs
push parent up to the superclass
convert JoinBase to a tree and remove the Node class
names are guaranteed to be symbols
eliminate function that is only used in one place
we will always detect the same node, so just pass the node in
we do not need to to_s the name all the time
parent is guaranteed to be the same
reduce number of comparisons and array allocations
rename the variable to make more sense with a tree
walk the tree rather than generating a hash and walking it
do not convert the tree to a list just for the first node
...
2013-10-09 15:36:47 -07:00
Aaron Patterson
7473c62508
remove dead code
2013-10-09 15:26:22 -07:00
Aaron Patterson
0cfb1de458
add some convenient methods for avoiding array allocations
2013-10-09 15:25:19 -07:00
Aaron Patterson
752a06ea8d
hide join_constraints inside the JoinDependency object
2013-10-09 15:21:34 -07:00
Aaron Patterson
92f95bbb33
speed up match?
2013-10-09 15:15:02 -07:00
Aaron Patterson
c6c4869612
expose the root node and call it
2013-10-09 15:14:55 -07:00
Aaron Patterson
a64f1ea08c
just skip the join if it's already there
...
Remove the annoying `find_or_build` stuff.
2013-10-09 15:08:22 -07:00
Aaron Patterson
4852a05ce6
speed up finding existing nodes
...
The node must be a child of the parent passed in, so only search
children of the parent node
2013-10-09 14:51:38 -07:00
Aaron Patterson
e73fbdf804
make node search more efficient
...
Rather than search every node in the tree, comparing that node and all
of its parents every time, start at the root from both sides and work
our way down the tree
2013-10-09 14:38:14 -07:00
Aaron Patterson
9b15db51b7
remove == so we can see where walking up parents occurs
2013-10-09 13:51:13 -07:00
Aaron Patterson
217aedf1bf
push parent up to the superclass
...
We always want a linked list back to the root node.
2013-10-09 11:23:45 -07:00
Aaron Patterson
40ad4397c1
convert JoinBase to a tree and remove the Node class
2013-10-09 11:14:58 -07:00
Arun Agrawal
91fe499275
Using flat_map instead of map and flatten
...
original commit 8998441967a8cfc6e4302c29664ab9d0acd77704
Reverted here ec8ef1e1055c4e1598da13f49d30261f07f4a9b4
2013-10-09 14:38:44 +02:00
Yves Senn
09b3b76f77
Merge pull request #12473 from claudiob/document-after-touch
...
Add documentation for after_touch [ci skip]
2013-10-09 02:09:52 -07:00
Rafael Mendonça França
0ee7331c35
Define the association extensions without need to have a builder
...
instance
2013-10-09 00:48:56 -03:00