Commit Graph

45789 Commits

Author SHA1 Message Date
Aaron Patterson
9f63a78d55 remove the mounted? method
we know the routes should not be "optimized" when mounting an
application
2014-07-28 14:07:53 -07:00
Aaron Patterson
099fd0efc4 remove some caching
this caching doesn't increase performance, but does increase complexity.
remove it for now and find better ways to speed up this code.
2014-07-28 13:57:05 -07:00
Rafael Mendonça França
6f66e7313b Merge pull request #16305 from tomkadwill/documented_change_table
Added documentation for change_table
2014-07-28 15:07:30 -03:00
Rafael Mendonça França
f5cec76ea8 Extract the transaction class to a local variable 2014-07-28 15:04:31 -03:00
Rafael Mendonça França
6501aeb286 Merge pull request #16284 from arthurnn/transactions
Transactions refactoring
2014-07-28 15:02:28 -03:00
Arthur Neves
d37bcc1d5a
savepoint_name should return nil for non-savepoint transactions
Also add test to assets the savepoint name
2014-07-28 13:51:59 -04:00
Arthur Neves
97bb76dc28
Transactions refactoring
Add a transaction manager per connection, so it can controls the
connection responsibilities.

Delegate transaction methods to transaction_manager
2014-07-28 13:51:44 -04:00
Rafael Mendonça França
4e116c56a8 Fix typo and remove code block since present is not a method. 2014-07-28 13:44:37 -03:00
Yves Senn
a09f025758 docs, clarify attribute query methods on numeric columns. Closes #16246.
[ci skip]
2014-07-28 17:30:43 +02:00
Yves Senn
171818c60c Merge pull request #16303 from rajcybage/removing_master
remove empty unused method
2014-07-28 17:22:53 +02:00
Tom Kadwill
9fb2fdc913 Added nodoc to change_table 2014-07-28 15:46:57 +01:00
Rafael Mendonça França
64e2e81bf9 Merge pull request #16297 from calebthompson/extract-iterator-method
Extract iterator method in AR::SchemaDumper
2014-07-28 10:58:23 -03:00
Rafael Mendonça França
7bd0af42d6 Merge pull request #16295 from kenn/no_stacktrace_drop_task
No verbose backtrace by db:drop when database does not exist.
2014-07-28 10:42:58 -03:00
Yves Senn
473819985a Merge pull request #16318 from zuhao/refactor_activerecord_adapter_test
make `adapter_test` run order independently.
2014-07-28 15:12:02 +02:00
Zuhao Wan
be58912c84 Add where condition so select_one returns the correct record. 2014-07-28 20:05:32 +08:00
Yves Senn
362cbabf3f Merge pull request #16319 from Domon/fix-each-validator-example
Fix example code of EachValidator [ci skip]
2014-07-28 14:00:40 +02:00
Chun-wei Kuo
524f7b494a Fix example code of EachValidator [ci skip]
We have to specify the `:title` option to really use the
`TitleValidator` defined above.
2014-07-28 18:35:28 +08:00
Jeremy Kemper
d94a0fe6b8 Merge pull request #16315 from eileencodes/fix-documentation-that-mentions-macro-instance-var
Fix documentation for `@macro` and reflection types
2014-07-27 18:09:30 -07:00
eileencodes
bd54e1956b [ci skip] Fix documentation for @macro and reflection types
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`
2014-07-27 20:05:40 -04:00
Kenn Ejima
2ee8419813 No verbose backtrace by db:drop when database does not exist. 2014-07-27 14:34:01 -07:00
Guillermo Iguaran
69133a4e00 Merge pull request #16282 from davidbalbert/patch-1
Fix protect_from_forgery docs [ci-skip]
2014-07-27 12:41:01 -05:00
David Albert
dce49f83c8 Fix protect_from_forgery docs 2014-07-27 13:20:58 -04:00
Rajarshi Das
f6a52f1e9d add comment to the empty each method for not removing it in future 2014-07-26 20:05:31 +05:30
David Heinemeier Hansson
da1b8a786c Fix that render layout should also be picked up by the template dependency tracker, but only half-ways. You can add that layout option on the same render call, and both templates should be added to the dependency tree. But thats going to require a more serious rework of the tracker. Please do help fix this part of it too. For now, render layout needs to be on its own line. 2014-07-25 16:37:18 -07:00
Caleb Thompson
75f3584d9b
Extract iterator method in AR::SchemaDumper
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.
2014-07-25 15:11:45 -05:00
Zachary Scott
a851f13d30 Merge pull request #16290 from a3gis/master
[ci skip] Fix documentation of SQLite3Adapter.columns where SQLite3Column was removed in e781aa31fc52a7c696115302ef4d4e02bfd1533b
2014-07-25 15:04:37 -04:00
Rafael Mendonça França
48cd7d337d Merge pull request #16285 from noinkling/password_digest_docs
Add password:digest information to scaffold generator help text
2014-07-25 13:39:59 -03:00
a3gis
775cc7de60 Remove references to SQLite3Column from documentation 2014-07-25 18:32:04 +02:00
a3gis
8f32ddba77 Fix documentation of SQlite3Adapter.columns
As of e781aa31fc SQLite3Column has been dropped.
2014-07-25 18:03:17 +02:00
Yves Senn
6d87b78ab3 docs, add ref where to find valid head status symbols.
[ci skip]
2014-07-25 15:31:24 +02:00
Yves Senn
38c2fec014 Merge pull request #16258 from mattwarrenrnp/master
adding indexes on tables in migration scripts [ci skip]
2014-07-25 11:26:04 +02:00
Yves Senn
1ec601b4e3 Merge pull request #16220 from pcreux/postgresql-jsonb-support
Add support for Postgresql JSONB
2014-07-25 11:16:30 +02:00
Matthew Draper
75eddfbca9 Merge pull request #16272 from tgxworld/fix_template_assertion_when_opening_a_session
Fix template assertion when opening a session.
2014-07-25 17:14:53 +09:30
noinkling
31d37826b3 Additional clarification on password:digest in scaffold and model generator help [ci skip] 2014-07-25 18:29:58 +12:00
noinkling
2a7fcc8c9b Add password:digest information to scaffold generator help text [ci skip] 2014-07-25 16:42:01 +12:00
Matt Warren
0f9118ab6f adding indexes on tables in migration scripts
missed one migration script in last commit

remove some empty lines

using the belongs_to index option to be more concise
2014-07-24 19:18:00 -02:30
Arthur Neves
368525a5a5
Remove finishing? method from transaction.
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:
9296e6939bcc786149a07dac334267c4035b623a
60c88e64e26682a954f7c8cd6669d409ffffcc8b
2014-07-24 16:25:34 -04:00
Philippe Creux
99b82fdf03 Add support for Postgresql JSONB
[Philippe Creux, Chris Teague]
2014-07-24 10:39:39 -07:00
Santiago Pastorino
3f4e97f807 Merge pull request #16281 from arthurnn/copy_default_proc_hwia
Make HWIA copy the default proc too.
2014-07-24 13:51:51 -03:00
Guo Xiang Tan
e6f2d4f685 Improve description of tests. 2014-07-25 00:43:45 +08:00
Guo Xiang Tan
cc10288e5f Bug fix for assert_template when opening a new session.
See https://github.com/rails/rails/pull/16234#commitcomment-7115670.
2014-07-25 00:38:50 +08:00
Arthur Neves
c17c262cfc
Make HWIA copy the default proc too.
[fixes #16279]
2014-07-24 11:48:24 -04:00
Yves Senn
5f25435bf4 tests, run adapter specific rake tests only for the right adapter. 2014-07-24 17:19:43 +02:00
Yves Senn
e63ae630e1 build fix, fix error introduced with 091b246bb0111357edbb9703ea342a944b04deb6
Fixes the following issue:

  1) Failure:
ActiveRecord::MySQLPurgeTest#test_establishes_connection_to_test_database [test/cases/tasks/mysql_rake_test.rb:200]:
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: ActiveRecord::Base.establish_connection(:test)
satisfied expectations:
- allowed any number of times, invoked once: #<Mock:0x2349430>.recreate_database(any_parameters)
- allowed any number of times, invoked once: ActiveRecord::Base.establish_connection(any_parameters)
- allowed any number of times, invoked once: ActiveRecord::Base.connection(any_parameters)
2014-07-24 17:00:14 +02:00
Yves Senn
091b246bb0 fix, mysql db:purge respects Rails.env.
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 (22e9a91189af2c4e6217a888e77f22a23d3247d1)
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

22e9a91189 (commitcomment-6834245)
2014-07-24 16:42:34 +02:00
a3gis
c0932162d2 Fix documentation typo in ConnectionSpecification::Resolve.spec 2014-07-24 14:23:36 +01:00
a3gis
98d2421ef9 Fixes #16265 2014-07-24 14:21:55 +01:00
Yves Senn
a208fb7647 clenaup, unify CHANGELOG format. [ci skip] 2014-07-24 14:53:19 +02:00
Matthew Draper
fa78378f76 Merge pull request #16280 from a3gis/master
Fixes #16265 and correct documentation typo
2014-07-24 22:08:16 +09:30
Yves Senn
2a67e12fdb pg, change_column_default, :table, :column, nil issues DROP DEFAULT.
Closes #16261.

[Matthew Draper, Yves Senn]

Using `DEFAULT NULL` results in the same behavior as `DROP DEFAULT`.
However, PostgreSQL will cast the default to the columns type,
which leaves us with a default like "default NULL::character varying".

/cc @matthewd
2014-07-24 14:27:41 +02:00