Commit Graph

47865 Commits

Author SHA1 Message Date
Robin Dupret
1d6d0cc245 Tiny documentation styling fixes [ci skip] 2014-11-02 12:32:50 +01:00
Zachary Scott
26126c8533 Merge pull request #17469 from rishijain/update_docs_2
added punctuations, and role of queue_adapter module [ci skip]
2014-11-02 01:21:11 -07:00
Sean Griffin
8b611b705b Merge pull request #17483 from pabloh/optimize_gsub_calls
Call gsub with a Regexp instead of a String for better performance
2014-11-01 18:48:23 -06:00
Sean Griffin
50e7c013c0 Don't duplicate predicate building logic in Relation finders 2014-11-01 18:16:46 -06:00
Sean Griffin
3ba9d32c6c Add a test case for range type casting
We support this behavior, but have no tests which assert that type
casting actually occurs.
2014-11-01 17:55:23 -06:00
Sean Griffin
4b53415295 Use a bound parameter for the "id = " portion of update statements
We need to re-order the bind parameters since the AST returned by the
relation will have the where statement as the first bp, which breaks on
PG.
2014-11-01 17:29:14 -06:00
Pablo Herrero
861b70e92f Call gsub with a Regexp instead of a String for better performance 2014-11-01 20:23:29 -03:00
Sean Griffin
daab7e59a6 Correctly cast calculation results on PG
MySQL reports the column name as `"MAX(developer_id)"`. PG will report
it as `"max"`
2014-11-01 17:15:55 -06:00
Zachary Scott
5e745dc3e2 Merge pull request #17482 from djpowers/patch-1
Add link to API Documentation Guidelines [ci skip]
2014-11-01 15:55:40 -07:00
Dave Powers
95b0e396cc Add link to API Documentation Guidelines
Link to the "English" section to specify American English be used for the Guides
[ci skip]
2014-11-01 18:39:28 -04:00
Sean Griffin
b380b1d21d [ci skip] Relation#bind is not public API 2014-11-01 15:58:32 -06:00
Sean Griffin
306d7a43b9 Fix test which failed in isolation
It was transitively relying on the vertex model being loaded
2014-11-01 15:49:12 -06:00
Sean Griffin
10f75af933 Use bind values for joined tables in where statements
In practical terms, this allows serialized columns and tz aware columns
to be used in wheres that go through joins, where they previously would
not behave correctly. Internally, this removes 1/3 of the cases where we
rely on Arel to perform type casting for us.

There were two non-obvious changes required for this. `update_all` on
relation was merging its bind values with arel's in the wrong order.
Additionally, through associations were assuming there would be no bind
parameters in the preloader (presumably because the where would always
be part of a join)

[Melanie Gilman & Sean Griffin]
2014-11-01 15:39:51 -06:00
Sean Griffin
a431df84b5 Merge pull request #17463 from mrgilman/remove-index-from-substitute-at
Remove redundant substitute index when constructing bind values
2014-11-01 14:39:59 -06:00
Richard Schneeman
acf314116c Merge pull request #17477 from Adam89/ma-remove-redundant-require
Remove redundant require of file
2014-11-01 15:24:41 -05:00
Godfrey Chan
70177618af Revert "development.rb should mention available log levels"
This reverts commit 102ba5fd69f18c7d58d70247090fbdeadfc53ca1.

Reason: code/template changes cannot be made in docrails
2014-11-01 12:37:41 -07:00
Sean Griffin
115cad36f4 Don't needlessly alphabetize columns for insert/update
This slightly simplifies the code, and reduces the number of times we
need to iterate over the attributes by one.
2014-11-01 13:13:15 -06:00
Adam89
52720b46ea Remove redundant require of file
This file was required inside 'test/validators/namespace/email_validator.rb'
that's already required here. Therefore I removed the redundant required.
2014-11-01 19:00:12 +00:00
Robin Dupret
30c3813cf0 Tiny documentation fixes and styling improvements
[ci skip]
2014-11-01 19:36:24 +01:00
Rafael Mendonça França
c465cdd503 Merge pull request #17474 from kuldeepaggarwal/fix-indentaion
add missing space.[ci skip]
2014-11-01 15:00:13 -02:00
Kuldeep Aggarwal
c551178f1b add missing space.[ci skip] 2014-11-01 22:18:05 +05:30
Thiago Pinto
102ba5fd69 development.rb should mention available log levels 2014-11-01 12:52:45 -02:00
Vipul A M
28eb085cdf - Remove unused duplicated method add_column_position from AbstractMysqlAdapter 2014-11-01 16:45:31 +05:30
Rishi Jain
19f6ac929b placed description at correct place [ci skip] 2014-11-01 10:29:34 +05:30
Zachary Scott
4ef891189d Merge pull request #17470 from keikun17/master
[ci skip] Fix line break on asset pipeline guide
2014-10-31 21:34:17 -07:00
Cakey | Buddy Magsipoc
d6b4f99bf1 Fix break on generated html
fixes this :

![http://i.imgur.com/86scI3a.png](http://i.imgur.com/86scI3a.png))
2014-11-01 12:12:13 +08:00
Aaron Patterson
bc3490c156 remove unused and untested API 2014-10-31 18:08:34 -07:00
Aaron Patterson
3dae34e217 fix set_pk_sequence and add a test for it. 2014-10-31 18:08:34 -07:00
Joe Rafaniello
4f6fb19662 Added region sequencing of primary keys for Postgres.
Skip setting sequence on a table create if the value is 0 since it will start the first value at 1 anyway.
This fixes the PG error 'setval: value 0 is out of bounds for sequence vms_id_seq...' encountered when migrating a new DB.

BugzID: 15452,9772,13475,16850
2014-10-31 18:08:34 -07:00
Melanie Gilman
08579e4078 Remove redundant substitute index when constructing bind values
We end up re-ordering them either way when we construct the Arel AST (in order
to deal with rewhere, etc), so we shouldn't bother giving it a number in the
first place beforehand.
2014-10-31 20:46:42 -04:00
Rishi Jain
84f313ab5d added punctuations, and role of queue_adapter module [ci skip] 2014-11-01 06:15:13 +05:30
Sean Griffin
45e8a4b6c9 Don't attempt to load the schema file in tests if none exists 2014-10-31 16:56:18 -06:00
Sean Griffin
4010a9ddc6 Don't modify the columns hash to set defaults from the attributes API
Nothing is directly using the columns for the default values anymore.
This step helps us get closer not not mutating the columns hash.
2014-10-31 16:06:14 -06:00
Sean Griffin
61bacd6ef9 Load test schema even if there are no migrations
Fixes #17170
2014-10-31 15:21:17 -06:00
Rafael Mendonça França
487145f871 Merge pull request #17040 from clyfe/patch-1
Explicit route test class
2014-10-31 18:57:56 -02:00
Rafael Mendonça França
0dd99f1003 Merge pull request #17305 from ziggythehamster/activerecord-connectionhandling-RAILS_ENV-without-rails
If Rails is not defined, check ENV["RAILS_ENV"] and ENV["RACK_ENV"] in ActiveRecord::ConnectionHandling
2014-10-31 17:51:52 -02:00
Rafael Mendonça França
23a132960c Merge pull request #17462 from vipulnsward/actionmailer-doc-fix
AM README fixes [ci skip]
2014-10-31 17:42:06 -02:00
Vipul A M
d3e410070d - Changed redundant user of deliver to deliver_now
- Wrapped text in setting defaults section. Also added break, to a sentence.
[ci skip]
2014-11-01 01:08:31 +05:30
Sean Griffin
6af9411c2d Use the correct values for int max and min
We had accidentally gone one power of two too far. In addition, we need
to handle minimum values as well as the maximum.
2014-10-31 13:25:16 -06:00
Robin Dupret
aeb431a6ca Tiny documentation improvements [ci skip] 2014-10-31 19:48:42 +01:00
Rafael Mendonça França
c1a118abc4 Merge branch 'tags-public-send'
Fixes #14180
Fixes #17461
2014-10-31 16:42:43 -02:00
Rafael Mendonça França
0d6a56d635 Improve test of private properties of objects in form tags 2014-10-31 16:41:51 -02:00
agius
1ff67d8286 Use public_send for form tags 2014-10-31 16:34:02 -02:00
Tobias Pfeiffer
f0570a3d3f Honor public/private in ActionView::Helpers::Tags::Base#value
* use public_send instead of send to avoid calling private
  methods in form helpers
2014-10-31 16:33:42 -02:00
Sean Griffin
ecb31131fb Merge pull request #17459 from sgrif/sg-find-by-large-numbers
Treat strings greater than int max value as out of range
2014-10-31 12:16:48 -06:00
Sean Griffin
e62fff40ed Treat strings greater than int max value as out of range
Sufficiently large integers cause `find` and `find_by` to raise
`StatementInvalid` instead of `RecordNotFound` or just returning `nil`.
Given that we can't cast to `nil` for `Integer` like we would with junk
data for other types, we raise a `RangeError` instead, and rescue in
places where it would be highly unexpected to get an exception from
casting.

Fixes #17380
2014-10-31 12:15:36 -06:00
Abdelkader Boudih
0249c360a3 Merge pull request #17460 from hbriggs/master
Masked authenticity token section, finder options details, misc typos [ci skip]
2014-10-31 17:57:41 +00:00
Hannah Briggs
d38d8d579c Add masked authenticity token section, details on finder options, misc typos [ci skip] 2014-10-31 10:50:37 -07:00
Sean Griffin
9b9f0197b7 Rename default_attributes to _default_attributes
It is internal use only. This is to avoid conflicting with users' method
names. Fixes #17458
2014-10-31 11:30:14 -06:00
Sean Griffin
53ec0bc055 Don't require calculations to be aliased to a column
Arel has changed so that `.sum` no longer aliases `SUM(the_column)` to
`sum_id`. This means the type returned by the adapter will be at the key
`"SUM(the_column)"`. Longer term, we should eventually be able to retain
type information from the AR::Base subclasses used in joined queries
2014-10-31 08:40:16 -06:00