aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Move TransactionManager to bottom of classArthur Neves2014-07-311-67/+67
|
* Merge pull request #16341 from arthurnn/transactions_remove_beginRafael Mendonça França2014-07-312-56/+20
|\ | | | | Transactions refactoring - 2
| * Make ClosedTransaction a null objectArthur Neves2014-07-311-16/+6
| |
| * Remove parent on Transaction objectArthur Neves2014-07-311-16/+9
| |
| * Remove being/number methods from transaction classArthur Neves2014-07-312-29/+10
| |
* | invert check so we fail fasterAaron Patterson2014-07-311-1/+1
| | | | | | | | | | there's no reason to to_sym the string if it doesn't match the regexp anyway
* | do a hash lookup for collision detectionAaron Patterson2014-07-312-1/+5
| | | | | | | | hash lookup should be faster than searching an array.
* | Merge pull request #16350 from JackDanger/test-rake-db-migrate-taskRafael Mendonça França2014-07-313-4/+24
|\ \ | | | | | | Add ActiveRecord::Tasks::DatabaseTasks.migrate
| * | Add ActiveRecord::Tasks::DatabaseTasks.migrateJack Danger Canty2014-07-313-4/+24
| | | | | | | | | | | | | | | | | | This extracts the logic that was embedded in a Rake task into a static method. Bonus: the first test for `rake db:migrate`
* | | Merge pull request #16361 from JackDanger/clearer-connection-pool-documentationRafael Mendonça França2014-07-311-15/+36
|\ \ \ | | | | | | | | [doc] Clarify how the ConnectionHandler works
| * | | Clarify how the ConnectionHandler worksJack Danger Canty2014-07-311-15/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the implicit description of how connection pooling works a little more explicit. It converts the examples of a model hierarchy into actual Ruby code and demonstrates how the key structure of the database.yml relates to the `establish_connection` method.
* | | | Merge pull request #16353 from ↵Rafael Mendonça França2014-07-312-29/+29
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | eileencodes/refactor-join_keys-usage-in-reflection Refactor join_keys to remove complex conditionals
| * | | | Refactor join_keys to remove complex conditionalseileencodes2014-07-312-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pushing conditionals down to through reflection Only the through association needs the part of this conditional that deals with belongs to and polymorphic? so that can be pushed down into the ThroughReflection reducing the conditionals. Remove conditional because we can delegate join keys to source reflection Remove need for source_macro checking By adding join_id_for to the other reflections we remove the need to cehck against the source_macro and can reduce the conditioanl from the original join_id_for(owner) Using polymorphism instead of testing the source_macro This case statement in join_association is almost exactly the same as the original join_keys code. Testing taht theory by creating a new join_dependency_keys(assoc_klass) method. Refactor join_keys further to be more concise Fixed format of "#:nodoc:" to "# :nodoc:" where I added them to this file.
* | | | | Realign assignments :scissors:Carlos Antonio da Silva2014-07-311-5/+5
| | | | |
* | | | | Do not reassign variable when mutation is happeningCarlos Antonio da Silva2014-07-311-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | These methods mutate the path variable/argument so there is no need to reassign it every time.
* | | | | Only concatenate path if it was given rather than converting blindlyCarlos Antonio da Silva2014-07-311-1/+1
| | | | |
* | | | | Rename variable to better show its intentCarlos Antonio da Silva2014-07-311-12/+12
| | | | |
* | | | | Simplify conditionalCarlos Antonio da Silva2014-07-311-3/+2
| | | | |
* | | | | Push options check up so we can simplify internal methodsCarlos Antonio da Silva2014-07-311-13/+10
|/ / / /
* | | | Merge pull request #16351 from ↵Rafael Mendonça França2014-07-313-11/+9
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | eileencodes/finish-refactoring-macro-to-eliminate-checking-against-symbols Redefine macro checks for reflections
| * | | | Redefine macro checks for reflectionseileencodes2014-07-303-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we define the macro on the reflection type we no longer need to check `macro == :what` on each type for `belongs_to?` or `has_one?` etc. These now default to false unless it's defined in the reflection class. Reuse existing belongs_to? method to check macros We don't need to do `:belongs_to == macro` anymore becasue we have a `belongs_to?` method. I didn't find this being used anywhere for `has_one?` or `collection?` since they were already fixed.
* | | | | Simplify code branch, remove #tapCarlos Antonio da Silva2014-07-311-7/+6
| | | | |
* | | | | Avoid a new hash objectCarlos Antonio da Silva2014-07-311-1/+1
| | | | |
* | | | | Fix assertion arguments orderCarlos Antonio da Silva2014-07-311-1/+1
| | | | |
* | | | | Avoid creating an extra hashCarlos Antonio da Silva2014-07-311-2/+2
| | | | |
* | | | | Remove unnecessary call to #tapCarlos Antonio da Silva2014-07-311-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This is not storying the RouteSet instance anywhere as the other examples in the file, so no need to use #tap.
* | | | | Merge pull request #16356 from gchan/add-hwia-testsYves Senn2014-07-311-0/+12
|\ \ \ \ \ | | | | | | | | | | | | Add tests to ensure default proc is used when `HashWithIndifferentAccess' is initialized with a block
| * | | | | Add tests to ensure default proc is used when `HashWithIndifferentAccess' is ↵Gordon Chan2014-07-311-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | initialized with a block
* | | | | | Merge pull request #16355 from xaviershay/validate-in-groups-of-argsAaron Patterson2014-07-302-0/+11
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Raise a descriptive error if non-positive integer passed to in_groups_of
| * | | | | Raise a descriptive error if non-positive integer passed to in_groups_of.Xavier Shay2014-07-302-0/+11
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is more consistent than the current behaviour of raising a `ZeroDivisionError: divided by 0` error when 0 is given, which can be non-obvious especially if `in_groups_of` is part of a longer chain of methods. The negative case was ok - "ArgumentError: invalid slice size" - but this error is clearer still.
* | | | | Properly assert for the expected messagesCarlos Antonio da Silva2014-07-301-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The message passed to Minitest's assert_raise is used as output in case the assertion fails, but we can test against the exact message by using the actual exception object that is returned from the assert_raise call.
* | | | | Avoid defining the test if it does not need to when not on JRubyCarlos Antonio da Silva2014-07-301-2/+2
| | | | |
* | | | | Use default argument when testing generators without the need for extra argsCarlos Antonio da Silva2014-07-302-7/+7
| | | | |
* | | | | Simplify path setupCarlos Antonio da Silva2014-07-301-1/+1
| | | | |
* | | | | Simplify plugin tests a bit, leave the regexp work for minitestCarlos Antonio da Silva2014-07-301-6/+6
| | | | |
* | | | | Invert unless..else conditions on JRuby checksCarlos Antonio da Silva2014-07-302-12/+12
| | | | |
* | | | | Merge pull request #16352 from gchan/remove-unnecessary-convert-keyCarlos Antonio da Silva2014-07-301-2/+2
|\ \ \ \ \ | | | | | | | | | | | | Removed unnecessary call to 'convert_key' in 'HashWithIndifferentAccess#to_hash'
| * | | | | Removed unnecessary call to 'convert_key' in 'HashWithIndifferentAccess#to_hash'Gordon Chan2014-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | All the keys are already Strings by virtue of being a HashWithIndifferentAccess.
* | | | | | Remove some more globals from testsCarlos Antonio da Silva2014-07-301-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are using blocks here so we have access to the environment around them, no need for globals.
* | | | | | Fix / improve some assertionsCarlos Antonio da Silva2014-07-301-6/+4
| | | | | |
* | | | | | Remove some globals from configuration testsCarlos Antonio da Silva2014-07-301-20/+20
| | | | | |
* | | | | | remove useless deupAaron Patterson2014-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | every call to default_resources_path_names allocates a new hash, no need to dup
* | | | | | push options inside the scope objectAaron Patterson2014-07-301-4/+9
| | | | | |
* | | | | | turn scope in to a linked listAaron Patterson2014-07-301-15/+36
| |/ / / / |/| | | | | | | | | | | | | | this makes scope rollback much easier
* | | | | don't access named routes internalsAaron Patterson2014-07-301-1/+1
| |/ / / |/| | | | | | | | | | | just ask whether or not the route is defined
* | | | remove alias_method_chainAaron Patterson2014-07-301-4/+2
| | | | | | | | | | | | | | | | we can `super` in to the previous implementation.
* | | | avoid instrospection on the moduleAaron Patterson2014-07-301-1/+2
| | | | | | | | | | | | | | | | | | | | we already know what helpers are path helpers, so just iterate through that list and define the helpers with warnings
* | | | fix variable nameAaron Patterson2014-07-301-3/+3
| | | |
* | | | split path_helpers and url_helpersAaron Patterson2014-07-301-18/+25
| | | | | | | | | | | | | | | | | | | | this lets us avoid hard coding a regexp for separating path and url helpers in the clear! method.
* | | | `add` will remove the method if it exists alreadyAaron Patterson2014-07-301-1/+0
| | | |