Commit Graph

43877 Commits

Author SHA1 Message Date
Sean Griffin
9f61f31c2c Use the generic type map for PostgreSQL OID registrations 2014-05-20 13:55:03 -07:00
Aaron Patterson
25c6726372 remove dead code 2014-05-20 13:25:14 -07:00
Aaron Patterson
c99ff6df00 cache the formatter on the path object 2014-05-20 13:25:14 -07:00
Aaron Patterson
e883db02bc translate AST to a formatter before url generation 2014-05-20 13:25:13 -07:00
Rafael Mendonça França
53008447ec Merge pull request #15200 from sgrif/sg-type-map-mysql
Use the generic type map object for mysql field lookups
2014-05-20 17:23:42 -03:00
Sean Griffin
ac4c1c3b0a Use the generic type map object for mysql field lookups 2014-05-20 13:22:39 -07:00
Yves Senn
f3407d1392 Merge pull request #15191 from camsong/master
Distinguish rake assets:clobber from rake assets:clean

[ci skip]
2014-05-20 21:40:22 +02:00
Rafael Mendonça França
59ee23f721 Merge pull request #15203 from sgrif/sg-delegate-type-cast
Replace `type_cast` case statement with delegation
2014-05-20 15:43:37 -03:00
Rafael Mendonça França
88d08f2ec9 Merge pull request #15187 from v-yarotsky/fix_confusing_delegation_exception
Fix confusing exception in ActiveSupport delegation
2014-05-20 15:20:54 -03:00
Aaron Patterson
74a847771f prepopulate the dispatch cache so we don't need the ThreadSafe cache. 2014-05-20 11:10:52 -07:00
Aaron Patterson
e08696421f make the each visitor top-down left-right 2014-05-20 11:00:27 -07:00
Rafael Mendonça França
4f41646577 Merge pull request #15201 from sgrif/sg-types-postgresql
Have Postgres OID types inherit from general types
2014-05-20 14:56:10 -03:00
Aaron Patterson
b713e207d4 fix multiple hash preloads. Fixes #14994 2014-05-20 10:16:57 -07:00
Rafael Mendonça França
9d835fd7f2 Merge pull request #15199 from sgrif/sg-types-mysql
Use general types for mysql fields
2014-05-20 13:27:36 -03:00
Sean Griffin
e781aa31fc Replace type_cast case statement with delegation
All subclasses of column were now delegating `type_cast` to their
injected type object. We can remove the overriding methods, and
generalize it on the `Column` class itself. This also enabled us to
remove several column classes completely, as they no longer had any
meaningful behavior of their own.
2014-05-20 09:15:22 -07:00
Sean Griffin
ca703bbc06 Use general types for mysql fields 2014-05-20 09:04:09 -07:00
Yves Senn
89ca6806a7 Merge pull request #15198 from sgrif/sg-delegate-type-cast-mysql
Delegate type_cast to injected type object in mysql
2014-05-20 17:59:53 +02:00
Sean Griffin
b2242d1fea Have Postgres OID types inherit from general types
Using general types where possible. Several more can go away once
infinity gets figured out.
2014-05-20 08:51:42 -07:00
Sean Griffin
ac37165597 Delegate type_cast to injected type object in mysql 2014-05-20 08:12:28 -07:00
Vladimir Yarotsky
6cc5a86a54 Fix confusing exception in ActiveSupport delegation 2014-05-20 08:10:40 -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
cam song
9aa807cc68 Distinguish rake assets:clobber from rake assets:clean 2014-05-20 20:04:33 +08:00
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