- 06 8月, 2014 1 次提交
-
- 05 8月, 2014 4 次提交
-
-
由 Bogdan Gusiev 提交于
-
由 Arthur Neves 提交于
Transaction class doesnt need to encapsulate the transaction state using inheritance. This removes all Transaction subclasses, and let the Transaction object controls different actions based on its own state. Basically the only actions would behave differently are `being`,`commit`,`rollback` as they could act in a savepoint or in a real transaction.
-
由 Carlos Antonio da Silva 提交于
The method has been removed in 09206716 (PR #16074), but the delegation was apparently missed, and one instance of the method was added back with the addition of OID::Xml in 336be2bd (PR #16072), so we can safely rm both.
-
由 eileencodes 提交于
We shouldn't be delegating chain to ThroughAssociation since the only place that needs to call it is `target_scope`. Instead we can call `reflecion.chain`.
-
- 03 8月, 2014 1 次提交
-
-
由 Jack Danger Canty 提交于
Updates documentation in line with changes made in 743b6750
-
- 02 8月, 2014 1 次提交
-
-
由 eileencodes 提交于
`source_macro` is no longer used in any ActiveRecord code. I've chosen to deprecate it because it was not marked as nodoc and may be in use outside of rails source.
-
- 01 8月, 2014 10 次提交
-
-
由 Jack Danger Canty 提交于
[ci skip]
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
Ruby generally does not use the is_* prefix on predicate methods.
-
由 Arthur Neves 提交于
-
由 Arthur Neves 提交于
-
由 Arthur Neves 提交于
-
由 Arthur Neves 提交于
-
由 Arthur Neves 提交于
-
由 Jack Danger Canty 提交于
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.
-
由 Jack Danger Canty 提交于
This extracts the logic that was embedded in a Rake task into a static method. Bonus: the first test for `rake db:migrate`
-
- 31 7月, 2014 4 次提交
-
-
由 joker1007 提交于
When I defines large precision column at RDBMS, I assigns float value, raise ArgumentError (precision too large).
-
由 eileencodes 提交于
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.
-
由 eileencodes 提交于
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.
-
由 Jack Danger Canty 提交于
These are the only instances of this in the whole code base.
-
- 29 7月, 2014 7 次提交
-
-
由 Arthur Neves 提交于
This piece of code was introduced on 67d8bb96 , which was calling `committed?` in the `transaction_state` before calling the `committed!` method. However on 7386ffc7, the `committed?` check was removed and replaced by a `finalized?`, which only checks if the state is not nil. Thus we can remove that line.
-
由 Satoru Yamasaki 提交于
-
由 Ponomarev Nikolay 提交于
-
由 Rafael Mendonça França 提交于
-
由 Arthur Neves 提交于
Also add test to assets the savepoint name
-
由 Arthur Neves 提交于
Add a transaction manager per connection, so it can controls the connection responsibilities. Delegate transaction methods to transaction_manager
-
由 Rafael Mendonça França 提交于
-
- 28 7月, 2014 4 次提交
-
-
由 Yves Senn 提交于
[ci skip]
-
由 Tom Kadwill 提交于
-
由 eileencodes 提交于
Since `@macro` doesn't exist anymore and these reflections are no longer AssociationReflections but their own types of reflections based on macro I updated the documentation to match the changes I made in #16089 and #16198. An `AssociationReflection` that had a `@macro` of `:has_many` now is a `HasManyReflection`
-
由 Kenn Ejima 提交于
-
- 26 7月, 2014 3 次提交
-
-
由 Caleb Thompson 提交于
Gems which wish to tie into ActiveRecord::SchemaDumper need to duplicate this logic currently. [Foreigner] is one such example, as is a library I'm currently working on but which hasn't been released yet: def tables_with_foreign_keys(stream) tables_without_foreign_keys(stream) @connection.tables.sort.each do |table| next if ['schema_migrations', ignore_tables].flatten.any? do |ignored| case ignored when String; table == ignored when Regexp; table =~ ignored else raise StandardError, 'ActiveRecord::SchemaDumper.ignore_tables accepts an array of String and / or Regexp values.' end end foreign_keys(table, stream) end end [Foreigner]: https://github.com/matthuhiggins/foreigner/blob/master/lib/foreigner/schema_dumper.rb#L36-L43 Extract the skip logic to a method, making it much simpler to follow this same behavior in gems that are tying into the migration flow and let them dump only tables that aren't skipped without copying this block of code. The above code could then be simplified to: def tables_with_foreign_keys(stream) tables_without_foreign_keys(stream) @connection.tables.sort.each do |table| foreign_keys(table, stream) unless ignored?(table) end end It also, in my opinion, simplifies the logic on ActiveRecord's side, and clarifies the intent of the skip logic.
-
由 a3gis 提交于
-
由 a3gis 提交于
As of https://github.com/rails/rails/commit/e781aa31fc52a7c696115302ef4d4e02bfd1533b SQLite3Column has been dropped.
-
- 25 7月, 2014 2 次提交
-
-
由 Arthur Neves 提交于
The finishing variable on the transaction object was a work-around for the savepoint name, so after a rollback/commit the savepoint could be released with the previous name. related: 9296e693 60c88e64
-
由 Philippe Creux 提交于
[Philippe Creux, Chris Teague]
-
- 24 7月, 2014 3 次提交
-
-
由 Yves Senn 提交于
Previously this method always established a connection to the test database. This resulted in buggy behavior when combined with other tasks like `bin/rake db:schema:load`. This was one of the reasons why #15394 (22e9a911) was reverted: > I’ve replicated it on a new app by the following commands: 1) rails generate model post:title, 2) rake db:migrate, 3) rake db:schema:load, 4) rails runner ‘puts Post.first’. The last command goes boom. Problem is that rake db:schema:load wipes the database, and then doesn’t actually restore it. This is all on MySQL. There’s no problem with SQLite. -- DHH https://github.com/rails/rails/commit/22e9a91189af2c4e6217a888e77f22a23d3247d1#commitcomment-6834245
-
由 a3gis 提交于
-
由 a3gis 提交于
-