Commit Graph

4662 Commits

Author SHA1 Message Date
Jon Leighton
bbe0a507f2 Remove unnecessary code from define_read_method and add assertion to make sure the underscored version is actually generated 2011-04-15 01:44:27 +01:00
Aaron Patterson
9951af0289 sort insert columns for better cache hits 2011-04-14 14:26:57 -07:00
Aaron Patterson
12ae92216b refactoring inserts to use the same method on the connection 2011-04-14 13:37:40 -07:00
Aaron Patterson
0268eac963 mimic prepared statements in the exec_insert for mysql2 2011-04-14 13:37:40 -07:00
Aaron Patterson
a22ceaeefa mysql type cast should return integers when typecasting true / false 2011-04-14 13:37:39 -07:00
Aaron Patterson
a0d4c8d1bf using the database adapter to typecast before executing prepared statement 2011-04-14 13:37:39 -07:00
Aaron Patterson
27f8c57f5f inserting big decimals as strings works consistently among dbs, so use string form 2011-04-14 13:37:39 -07:00
Aaron Patterson
8571facea3 insert statements are prepared, but values are not escaped properly 2011-04-14 13:37:39 -07:00
Aaron Patterson
4893170da2 adding a type cast method for prepared statements 2011-04-14 13:37:38 -07:00
Jon Leighton
6b6ecbefad Extract the constraint-building for joins in JoinAssociation into a separate method to make it easy to change/override (requested by Ernie Miller so that MetaWhere can add to it easily) 2011-04-14 19:34:19 +01:00
Stian Grytøyr
93641ed6c8 Fixes performance issue introduced in 3.0.6 (issue #6695) 2011-04-14 08:56:02 -07:00
Aaron Patterson
1f4dae9daa do not depend on to_yaml being called, but rather depend on YAML being dumped 2011-04-13 11:41:42 -07:00
Aaron Patterson
eebb19c954 use index based substitution for bind parameters 2011-04-13 09:42:51 -07:00
Prem Sichanugrist
733bfa63f5 Remove #among? from Active Support
After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now.

It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
2011-04-13 20:25:28 +08:00
Jon Leighton
f0e198bfa1 Deprecate defining scopes with a callable (lambda, proc, etc) via the scope class method. Just define a class method yourself instead. 2011-04-12 19:46:05 -07:00
Jon Leighton
788bd30859 ActiveRecord::Base.scopes hash is not needed 2011-04-12 19:46:04 -07:00
Jon Leighton
8572ae6671 Evaluate default scopes at the last possible moment in order to avoid problems with default scopes getting included into other scopes and then being unable to remove the default part via unscoped. 2011-04-12 19:46:04 -07:00
Jon Leighton
5740d4ec0c Deprecated support for passing hashes and relations to default_scope, in favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details. 2011-04-12 19:46:04 -07:00
Jon Leighton
fc9a04b6a6 Removing the scope-caching which happens on association proxies, because the query is already cached by the query cacher. For formalised proof see http://www.youtube.com/watch?v=wDefXLb-FDs 2011-04-12 19:46:04 -07:00
Aaron Patterson
b53ffb35e0 stop using deprecated methods in arel 2011-04-11 15:50:05 -07:00
David Heinemeier Hansson
d1575ae1b9 Change Object#either? to Object#among? -- thanks to @jamesarosen for the suggestion! 2011-04-12 00:23:07 +02:00
Aaron Patterson
5918b868b2 remove so many nested if statements 2011-04-11 15:19:10 -07:00
Aaron Patterson
622f23b604 wrap the pg_get_serial_sequence function and reuse it for the default sequence name 2011-04-11 14:38:42 -07:00
Aaron Patterson
75dc9fbac7 cache table exists queries in prepared statement cache 2011-04-11 14:12:31 -07:00
Aaron Patterson
f6c0c8ff61 only use the primary_key method, refactor schema and table name parsing 2011-04-11 14:08:27 -07:00
Aaron Patterson
a9e8554b46 use prepared statements for primary key queries 2011-04-11 13:57:00 -07:00
Aaron Patterson
5df072d64b last insert id can never be called, so remove that code path 2011-04-11 13:10:20 -07:00
Aaron Patterson
9ba94c8fc4 we know the table and pk, so we can calculate a default sequence name 2011-04-11 10:54:08 -07:00
Aaron Patterson
cbb65de1a6 always look up pk and sequence unless both are provided 2011-04-11 10:37:23 -07:00
Aaron Patterson
302b6f3f73 pg does not know the insert_id in advance, so super will never return true 2011-04-11 10:31:13 -07:00
Aaron Patterson
4c30304e15 updating the docco for ActiveRecord::Result 2011-04-11 10:10:01 -07:00
Aaron Patterson
269cd1b3c5 implement exec_query on mysql2 adapter 2011-04-11 10:10:01 -07:00
Aaron Patterson
8a11799a47 make sqlite insert_sql more consistent with other adapters 2011-04-11 10:10:01 -07:00
Aaron Patterson
58259bbf29 adding exec_insert for postgresql 2011-04-11 10:10:01 -07:00
Aaron Patterson
90a371496a properly name schema queries for the logger 2011-04-11 10:10:01 -07:00
Aaron Patterson
0845b5062d adding client_encoding method for discovering the encoding set for this client, testing exec_insert on a string 2011-04-11 10:10:00 -07:00
Aaron Patterson
f9d3f01866 properly name schema queries for logging 2011-04-11 10:10:00 -07:00
Aaron Patterson
32dbf00d99 adding exec_insert to sqlite3 2011-04-11 10:10:00 -07:00
Aaron Patterson
c4fc396300 adding a case_sensitive_modifier for forcing comparisons to be case sensitive 2011-04-11 10:02:39 -07:00
Aaron Patterson
35b2715456 only support pg >= 8.2, so no need to check 2011-04-11 09:08:45 -07:00
Aaron Patterson
1f3d3eb49d pg should define insert_sql so that query cache actually works for inserts 2011-04-10 22:45:14 -07:00
Aaron Patterson
35dba50be9 community support for pg < 8.2 has ended, so we can drop support for those versions 2011-04-10 22:30:27 -07:00
Brian Cardarella
a30b440deb Refactored uniqueness validator to use Arel instead of hardcoded SQL 2011-04-10 21:28:12 -07:00
Prem Sichanugrist
a9f3c9da01 Using Object#in? and Object#either? in various places
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
2011-04-11 03:17:09 +08:00
José Valim
62b2755f7a Remove dead branch code that appeared back in a merge. 2011-04-10 13:03:49 +02:00
Durran Jordan
a9b4b5da7c Destroying records via nested attributes works independent of reject_if:
- When a :_destroy truthiness is provided in the attributes hash, the
  record should get destroyed regardless of the result of the proc or
    method supplied to :reject_if. (If :allow_destroy is true)

[#6006 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-04-05 10:38:54 -03:00
Emilio Tagua
454ec93ff7 Add log message when loading records from Identity Map.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-04 10:48:17 +02:00
Emilio Tagua
b35617235d Use IM when trying to load records using ID.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-04 10:48:12 +02:00
Xavier Noria
3e24e9ebc2 Merge branch 'master' of git://github.com/lifo/docrails 2011-04-03 22:22:03 +02:00
Akira Matsuda
bd3cdeea35 s/ERb/ERB/g
The author of ERB sais, his eRuby implementation was originally named "ERb/ERbLight" and then renamed to "ERB" when started bundled as a Ruby standard lib.
http://www2a.biglobe.ne.jp/~seki/ruby/erb.html
2011-04-03 12:47:51 +09:00