Commit Graph

45618 Commits

Author SHA1 Message Date
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
Matthew Draper
f3478f8413 Merge pull request #16276 from y-yagi/bug_report_templates
[ci skip]Add i18n master to the Gemfile
2014-07-24 20:36:34 +09:30
yuuji.yaginuma
ea88b8e8c3 [ci skip]Add i18n master to the Gemfile 2014-07-24 17:08:11 +09:00
Matthew Draper
7e20b9449a Merge pull request #16260 from akshay-vishnoi/doc-change
Calling require_self twice in css raises Sprockets::ArgumentError exception [ci skip]
2014-07-24 17:30:22 +09:30
Akshay Vishnoi
2e679ac262 Calling require_self twice in css raises Sprockets::ArgumentError exception [ci skip] 2014-07-24 11:39:41 +05:30
Rafael Mendonça França
b17330cf39 Remove mocha usage 2014-07-23 19:01:44 -03:00
Rafael Mendonça França
23cb26cfac Fix syntax error 2014-07-23 18:30:27 -03:00
Rafael Mendonça França
ecef1776a0 Dev and edge application and plugins need to include i18n master 2014-07-23 18:05:57 -03:00
Rafael Mendonça França
bec08e7744 Merge pull request #16267 from robin850/rbx-yaml
Set Psych as the YAML engine for Rubinius
2014-07-23 17:45:15 -03:00
Rafael Mendonça França
cd7d414e48 Do not set enforce_available_locales to i18n 0.7
Now the default is always true.

Users still can set it using config.i18n.enforce_available_locales.
2014-07-23 17:40:44 -03:00
Robin Dupret
558f8aa2ee Set Psych as the YAML engine for Rubinius
Since the rubysl-yaml gem doesn't ship with Psych by default because of
its dependency on libyaml, on Rubinius, the default engine is Syck.

However, if we want to be able to run the application safely on
different rubies, we need to make people using Rubinius rely on Psych.

See http://git.io/uuLVag for further information.
2014-07-23 20:05:14 +02:00
Rafael Mendonça França
af216b7431 Split Action Pack tests in a new job on travis
This will make easier to compare run time between Ruby 2.1 and trunk
2014-07-23 14:58:59 -03:00
Rafael Mendonça França
decb83b9fd Use PROCESS_COUNT to define the number of parallel executors 2014-07-23 14:40:43 -03:00
Aaron Patterson
0b773c30fb specify N=0 to prevent parallel tests (just run tests on the main process) 2014-07-23 10:38:52 -07:00
Arthur Nogueira Neves
8c48a70824 Merge pull request #16237 from tonytonyjan/patch
`create` method returns an active record object with errors instead of false when validation fails. [skip ci]
2014-07-23 13:02:12 -04:00
Tony Jian
d0af905925 create return an active record object with erros instead of false when validation fails. [skip ci] 2014-07-23 16:31:55 +08:00
Yves Senn
74a157ac5f Merge pull request #16234 from tgxworld/fix_template_assertion_for_integration_test
Fix AC::TemplateAssertions instance variables not resetting.
2014-07-22 22:19:17 +02:00