Commit Graph

5222 Commits

Author SHA1 Message Date
Xavier Noria
236f1f52cd Merge branch 'master' of git://github.com/lifo/docrails 2011-01-20 10:33:38 +01:00
Aaron Patterson
a282301a77 we have a method for setting preloaded records, so use it 2011-01-18 16:33:18 -08:00
Aaron Patterson
c107849a99 reduce objects, reduce loops and function calls while building the conditional 2011-01-18 15:52:57 -08:00
Aaron Patterson
f3a5995bbf keys will always be strings in the id => record map 2011-01-18 15:52:57 -08:00
Aaron Patterson
9e42f1b416 reduce method calls and loops when dealing with custom conditions 2011-01-18 15:52:57 -08:00
Aaron Patterson
ba62a87b8b ony bother with record map keys when we need them 2011-01-18 15:52:57 -08:00
Aaron Patterson
4bc9bacd94 refactor elaborate group_by in to a normal group_by 2011-01-18 15:52:57 -08:00
Aaron Patterson
e6881217ed fixing bug where 1.8 hangs while running pg tests 2011-01-18 10:49:50 -08:00
Aaron Patterson
11fe2161ce remove unnecessary module_eval 2011-01-18 09:36:33 -08:00
Aaron Patterson
9d549986dd remove useless conditional 2011-01-17 16:42:34 -08:00
Jaime Iniesta
4b7dad2df3 ActiveRecord#save(false) is now deprecated, now it is save(:validate => false) 2011-01-18 00:35:07 +01:00
Aaron Patterson
fdfabc99e8 fixing unused variable warnings 2011-01-17 14:22:17 -08:00
Jon Leighton
7a3f05f43d Add CHANGELOG entry for the addition of create_association! methods on has_one and belongs_to 2011-01-16 13:43:54 -08:00
Jon Leighton
d1521719c5 Removed support for accessing attributes on a has_and_belongs_to_many join table. This has been documented as deprecated behaviour since April 2006. Please use has_many :through instead. A deprecation warning will be added to the 3-0-stable branch for the 3.0.4 release. 2011-01-16 13:43:54 -08:00
Jon Leighton
c4458b3602 Rename some variables 2011-01-16 13:43:54 -08:00
Jon Leighton
8aedd722e1 Use self.target= in HasOneThroughAssociation too 2011-01-16 13:43:54 -08:00
Jon Leighton
b7594a0756 find_target can also go into SingularAssociation 2011-01-16 13:43:53 -08:00
Jon Leighton
f1a15c2197 Abstract a bit more into SingularAssociation 2011-01-16 13:43:53 -08:00
Jon Leighton
115eedbb41 Use self.target= rather than @target= as the former automatically sets loaded 2011-01-16 13:43:53 -08:00
Jon Leighton
ef79b91784 Abstract common code from BelongsToAssociation and HasOneAssociation into SingularAssociation 2011-01-16 13:43:53 -08:00
Jon Leighton
bf24fe810c belongs_to records should be initialized within the association scope 2011-01-16 13:43:53 -08:00
Jon Leighton
3ef693724c Document the new create_association! method on one-to-one associations 2011-01-16 13:43:53 -08:00
Jon Leighton
52c47556b7 Add create_association! for belongs_to 2011-01-16 13:43:53 -08:00
Xavier Noria
15e71347f6 updates AR's CHANGELOG with changes in 9e64dfa and ad343d7 2011-01-16 18:55:35 +01:00
Aaron Patterson
0aef847927 push !loaded? conditional up 2011-01-14 17:08:27 -08:00
Aaron Patterson
b8ed2d5ddf return early in case the left or right side lists are empty 2011-01-14 17:03:15 -08:00
Aaron Patterson
75e29e871e only find_target can raise the exception, so isolate the rescue around that call 2011-01-14 16:57:14 -08:00
Aaron Patterson
f548054700 we always have a target, so stop checking 2011-01-14 16:54:02 -08:00
Aaron Patterson
f5d2cb9cac we should use [] instead of Array.new 2011-01-14 16:50:26 -08:00
Aaron Patterson
17687e4f96 @target is always a list, so stop doing is_a? checks 2011-01-14 16:47:31 -08:00
Aaron Patterson
2afd6c75f1 move complex logic to it's own method 2011-01-14 16:46:02 -08:00
Jordi Romero
b31ef7ee83 document ActiveRecord's except and only
Document methods that allow easily override arel queries
2011-01-15 01:17:53 +01:00
Aaron Patterson
a0a69b045a loaded? will not raise an AR::RecordNotFound exception, so move the rescue inside the conditional 2011-01-14 15:58:59 -08:00
Aaron Patterson
c326969745 reduce funcalls by using falsey objects 2011-01-14 14:45:46 -08:00
Aaron Patterson
dc11a77ab7 write the delegate method directly to avoid delegate callstack overhead 2011-01-14 14:40:11 -08:00
Aaron Patterson
ef4ffed660 reduce some lasigns 2011-01-14 14:30:47 -08:00
Aaron Patterson
2947197421 use rake to create test databases for us 2011-01-14 14:07:16 -08:00
Aaron Patterson
f30a3106f3 transactional fixtures must be set to false for this test 2011-01-14 13:45:30 -08:00
Aaron Patterson
92499b3c7e Arel::Table.engine will be deprecated, so stop using it 2011-01-14 13:11:24 -08:00
Aaron Patterson
1e9685f159 preheat the table cache in arel 2011-01-14 11:16:31 -08:00
Santiago Pastorino
3755ae04a1 Add missing require 2011-01-14 17:11:15 -02:00
Santiago Pastorino
9a57a2279e sorry, the CI cannot lie to us anymore (Part II) 2011-01-13 10:55:41 -02:00
Aaron Patterson
3165dca28c include_in_memory? should check against @target list in case of new records. [#6257 state:resolved] 2011-01-12 18:07:53 -08:00
Aaron Patterson
e1beb7d287 use array maths rather than *args 2011-01-12 15:15:45 -08:00
Aaron Patterson
8f9944d5bc just use return value of load_target 2011-01-12 14:29:17 -08:00
Aaron Patterson
e9980f17fd just call methods on return value of load_target 2011-01-12 14:27:08 -08:00
Aaron Patterson
bc993c690b default return value is nil 2011-01-12 14:27:08 -08:00
Aaron Patterson
49696e0a62 @loaded is defined in initialize, so we should not need this 2011-01-12 14:27:08 -08:00
Aaron Patterson
8bee98fe3a just use respond_to? and super rather than aliasing around methods 2011-01-12 14:27:08 -08:00
Aaron Patterson
f8700038af adding a test for no method error 2011-01-11 17:57:02 -08:00