Commit Graph

43857 Commits

Author SHA1 Message Date
Sean Griffin
ac37165597 Delegate type_cast to injected type object in mysql 2014-05-20 08:12:28 -07:00
Yves Senn
d17b056571 Merge pull request #15197 from sgrif/sg-delegate-type-cast-sqlite3
Delegate `#type_cast` to injected type objects on SQLite3
2014-05-20 16:39:25 +02:00
Sean Griffin
36fde2b704 Delegate #type_cast to injected type objects on SQLite3 2014-05-20 07:36:58 -07:00
Matthew Draper
f9860fcbe2 Merge pull request #14965 from eric-chahin/issue_14824
Fixed the inferred table name of a HABTM auxiliar
2014-05-20 23:15:08 +09:30
Eric Chahin
1f4daf15f8 Fixed the inferred table name for HABTM within a schema
Fixes #14824.
2014-05-20 23:13:28 +09:30
Yves Senn
528aff1288 Merge pull request #15192 from simi/guides-binstubs
Use generated binstubs in guides examples. [ci skip]
2014-05-20 13:40:26 +02:00
Josef Šimánek
981dda53db Use generated binstubs in guides examples.
[ci skip]
2014-05-20 13:29:18 +02:00
Yves Senn
8f8dfa488a fix rake test_sqlite3_mem.
While running Sqlite3 memory tests I encountered the following error:

```
Finished in 69.416366s, 58.0267 runs/s, 162.3681 assertions/s.

  1) Error:
ActiveRecord::Migration::ChangeSchemaTest#test_add_column_with_timestamp_type:
NoMethodError: undefined method `type' for nil:NilClass
    /Users/senny/Projects/rails/activerecord/test/cases/migration/change_schema_test.rb:244:in `test_add_column_with_timestamp_type'

4028 runs, 11271 assertions, 0 failures, 1 errors, 1 skips
```

This was because the table `testings` was used in multiple test-cases.
This resulted in a wrongly cached schema on `ActiveRecord::Base.schema_chae`.

/cc @zuhao
2014-05-20 11:21:16 +02:00
Yves Senn
60bd2432b2 docs, instantiate expects String keys. [Rafal Piekarski & Yves Senn]
Closes #15122
Closes #15107
2014-05-20 10:37:17 +02:00
Yves Senn
7591e8c1a7 Merge pull request #15182 from zuhao/refactor_actionpack_respond_with_test_2
Un-define :to_json for Customer class after stubbing.
2014-05-20 08:58:17 +02:00
Zuhao Wan
f0440205f6 Add using_resouce_with_json to controller. 2014-05-20 14:52:06 +08:00
Yves Senn
00d1b132c0 Merge pull request #15178 from zuhao/refactor_actionpack_respond_with_test
Deregister csv renderer after test to prevent leak.
2014-05-20 08:21:32 +02:00
Aaron Patterson
fe06e9ac23 make the AST go from left to right, rather than right to left 2014-05-19 17:46:27 -07:00
Aaron Patterson
dc2e3ea8c4 fix escaping in generation 2014-05-19 16:43:16 -07:00
Aaron Patterson
62d1b330c4 Revert "Rewrite journey routes formatter for performance"
This reverts commit 5c224de9e110763ec7a0f01f5b604bcf81f40bfb.

Conflicts:
	actionpack/lib/action_dispatch/journey/visitors.rb

5c224de9e110763ec7a0f01f5b604bcf81f40bfb introduced a bug in the
formatter.  This commit includes a regression test.
2014-05-19 16:14:47 -07:00
Rafael Mendonça França
03035d69e1 Merge pull request #15184 from sgrif/sg-remove-timestamp-type
Remove :timestamp column type
2014-05-19 18:56:00 -03:00
Sean Griffin
d0f8c46e19 Remove :timestamp column type
The `:timestamp` type for columns is unused. All database adapters treat
them as the same database type. All code in `ActiveRecord` which changes
its behavior based on the column's type acts the same in both cases.
However, when the type is passed to code that checks for the `:datetime`
type, but not `:timestamp` (such as XML serialization), the result is
unexpected behavior.

Existing schema definitions will continue to work, and the `timestamp`
type is transparently aliased to `datetime`.
2014-05-19 11:32:13 -07:00
Zuhao Wan
ac36b45672 Add ActionController::Renderers.remove. 2014-05-20 02:00:57 +08:00
Rafael Mendonça França
09cc922ed3 Merge pull request #15155 from dskang/digest
Default config.assets.digests to true in development
2014-05-19 14:47:39 -03:00
Rafael Mendonça França
361d2ff615 Fixing test order issues 2014-05-19 14:35:33 -03:00
Rafael Mendonça França
889f61efff Merge pull request #10798 from jcxplorer/fix-enable_extension-with-table_name_prefix
Fix migrations that use enable_extension with table_name_prefix/suffix

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/migration.rb
2014-05-19 13:32:15 -03:00
Yves Senn
4273554c5f Merge pull request #15158 from sgrif/sg-delegate-type
Delegate `Column#type` to the injected type object
2014-05-19 17:18:17 +02:00
Sean Griffin
0b682e4b05 Delegate Column#type to the injected type object
The decision to wrap type registrations in a proc was made for two
reasons.

1. Some cases need to make an additional decision based on the type
  (e.g. a `Decimal` with a 0 scale)
2. Aliased types are automatically updated if they type they point to is
  updated later. If a user or another adapter decides to change the
  object used for `decimal` columns, `numeric`, and `number` will
  automatically point to the new type, without having to track what
  types are aliased explicitly.

Everything else here should be pretty straightforward. PostgreSQL ranges
had to change slightly, since the `simplified_type` method is gone.
2014-05-19 08:07:21 -07:00
Yves Senn
a0eec57ef0 test, inline DeveloperWithAggregate, which is used by a single test. 2014-05-19 14:11:45 +02:00
Rafael Mendonça França
b52e6393d3 Merge pull request #15168 from eileencodes/return-early-on-delete-and-destroy-methods
Return early on delete and destroy methods
2014-05-19 08:39:45 -03:00
Rafael Mendonça França
88ee30ad1d Merge pull request #14126 from schuetzm/index_option_for_column
Make `:index` in migrations work with all column types
2014-05-19 08:06:37 -03:00
Rafael Mendonça França
85b78fcda5 Merge pull request #15160 from sgrif/sg-destructured-each
Use destructured arguments when looping through pairs
2014-05-19 07:57:55 -03:00
Yves Senn
d4cec31240 pg, re-introduce PostgreSQL::Utils to unify schema/table extraction.
Partial revert of c0bfc3f412834ffe8327a15ae3a46602cc28e425
2014-05-19 12:20:30 +02:00
Yves Senn
881cab448c pg, add missing nodocs for extracted modules. 2014-05-19 11:48:23 +02:00
Yves Senn
c6ee495e2e Merge pull request #14962 from arunagw/aa-fix-rake-activerecord
Reorganize ActiveRecord tasks [Arun Agrawal & Abd ar-Rahman Hamidi]
2014-05-19 09:34:43 +02:00
Yves Senn
e153fbfe63 pg guide, move introductory sentences into main content. [ci skip]
This is a reaction to 7ca75f3789 (commitcomment-6303828)
2014-05-19 09:14:58 +02:00
Yves Senn
d29074af7a Merge pull request #15156 from sgrif/sg-postgres-timestamps
PostgreSQL timestamps should always be datetimes
2014-05-18 22:02:56 +02:00
Aaron Patterson
239f560630 Feature detect based on Ruby version.
I didn't want to do this, FNM_EXTGLOB is defined on 2.1.x, but Dir.glob
returns the wrong value on Ruby less than 2.2.0.  Checking for a
case-insensitive FS seems too hard, so just check Ruby version  Checking
for a case-insensitive FS seems too hard, so just check Ruby version.
2014-05-18 12:00:12 -07:00
Robin Dupret
623da13256 A tiny pass through the PostgreSQL guide [ci skip] 2014-05-18 18:58:50 +02:00
Vijay Dev
ddf32daed8 copy edits[ci skip] 2014-05-18 16:01:31 +00:00
Yves Senn
1963aa3e88 Merge pull request #15157 from msgehard/remove_cruft_in_has_secure_password
Remove cruft now that strong_parameters is default [ci skip]
2014-05-18 17:13:00 +02:00
Yves Senn
4d8c6c558f Merge pull request #15169 from Gaurav2728/gaurav-ecosystem
remove ecosystem link that is broken [ci skip]
2014-05-18 17:08:38 +02:00
Gaurav Sharma
67de652fbb remove ecosystem link that is broken 2014-05-18 19:17:09 +05:30
Mike Gehard
8dd801d6ca Let others know why this code is here
[ci skip]
2014-05-18 06:47:37 -06:00
eileencodes
540262afd7 early return on delete and destroy methods
When delete or destroy is called on all records nothing
is deleted or destroyed. Intead of running through the code and still
not deleteing anything, we should early return
2014-05-18 07:52:04 -04:00
Marc Schütz
9a0d35e820 Make :index in migrations work with all column types 2014-05-18 11:26:41 +02:00
Dan Kang
f369bcf9a0 Default config.assets.digests to true in development 2014-05-17 23:01:22 -04:00
Yves Senn
dbbcc8388a Merge pull request #15151 from sgrif/sg-add-type-to-column
Add a type object to Column constructor
2014-05-18 01:17:00 +02:00
Sean Griffin
4bd5dffc85 Add a type object to Column constructor
Part of #15134. In order to perform typecasting polymorphically, we need
to add another argument to the constructor. The order was chosen to
match the `oid_type` on `PostgreSQLColumn`.
2014-05-17 17:16:05 -06:00
Sean Griffin
113f56d31d Use destructured arguments when looping through pairs
Minor refactoring of looping behavior for aggregation
2014-05-17 14:50:24 -06:00
Sean Griffin
d070a657c0 PostgreSQL timestamps are always datetimes
The current behavior is that they are treated as `datetime` normally,
but if they are part of an array, they are treated as `timestamp`. The
only place that seems to be impacted by this is schema dumping, which
shouldn't matter since `t.datetime` and `t.timestamp` are equivalent in
the `PostgreSQL` adapter, anyway.
2014-05-17 14:04:23 -06:00
Rafael Mendonça França
7359f8190d Merge pull request #15137 from sgrif/sg-remove-dead-code
Remove dead test code for unsupported adapters
2014-05-17 16:26:19 -03:00
Sean Griffin
8df8334327 Remove dead test code for unsupported adapters 2014-05-17 13:24:25 -06:00
Rafael Mendonça França
067131524b Merge pull request #14428 from jnormore/reset_counters_alias
Updates reset_counters to allow counter name in params
2014-05-17 16:21:41 -03:00
Zachary Scott
7caf3ffffd Document method visibility for designing API docs. [ci skip]
cc https://github.com/rails/rails/issues/14848#issuecomment-41198795
2014-05-17 16:11:33 -03:00