Commit Graph

41807 Commits

Author SHA1 Message Date
Aaron Patterson
0167765e3f methods are defined right after the module_eval, so we don't need to do
any line number maths
2014-01-15 16:07:12 -08:00
Carlos Antonio da Silva
f2f723bca9 Get rid of unused TransactionError constant
This has been added 9 years ago in
a677da209b16f43198b3485dda89dce862fb9bfb, and removed 6 years ago in
38f8252e2d0a109d1b833d6b289cd989e7bfffe4.
2014-01-15 21:15:26 -02:00
Carlos Antonio da Silva
885f3ae390 Avoid converting :on option to array twice when defining commit/rollback callbacks 2014-01-15 21:10:23 -02:00
Carlos Antonio da Silva
1c88b363a3 Unify changelog entries about single quotes [ci skip] 2014-01-15 19:26:00 -02:00
Carlos Antonio da Silva
b59204dba4 Merge pull request #13713 from chulkilee/use-single-quotes
Use single quotes in generated files
2014-01-15 13:24:56 -08:00
Aaron Patterson
8d146c8bec rm dup code
e64a83cdbd/activerecord/test/cases/relation/merging_test.rb (L80-91)
2014-01-14 17:47:10 -08:00
Aaron Patterson
3204bbf879 directly create the ARel AST
rather than allocating a new Relation, just make the AST directly
2014-01-14 16:46:26 -08:00
Godfrey Chan
e64a83cdbd Updated comment to mention the enum mapping class method [ci skip] 2014-01-14 15:41:44 -08:00
Aaron Patterson
ce95fb2991 "string" isn't a valid column type for ActiveRecord
Conflicts:
	activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
2014-01-14 14:01:10 -08:00
Chulki Lee
1ab6c656d6 Use single quotes in generated files 2014-01-14 11:13:42 -08:00
Yves Senn
b23330745b don't establish a new connection when testing with sqlite3_mem.
This fixes broken `rake test_sqlite3_mem` suite for Active Record.
The problem is that that the old database with the schema is lost
when establishing a new connection. Upon reconnting we are left
with a blank database and tests down the line start failing.
2014-01-14 18:03:31 +01:00
Yves Senn
93b38d54df Merge pull request #13350 from ccutrer/sqlite-partial-indexes
sqlite >= 3.8.0 supports partial indexes
2014-01-14 07:58:06 -08:00
Cody Cutrer
547ed45633 sqlite >= 3.8.0 supports partial indexes 2014-01-14 08:53:32 -07:00
Andrew White
8a60f479b0 Merge pull request #13710 from ujjwalt/hotfix/sti
Active Record's subclass_from_attributes shouldn't assume :type is for STI unless there is a type column.
2014-01-14 07:05:54 -08:00
Ujjwal Thaakar
e8d1d84837
Don't try to get the subclass if the inheritance column doesn't exist
The `subclass_from_attrs` method is called even if the column specified by
the `inheritance_column` setting doesn't exist. This prevents setting associations
via the attributes hash if the association name clashes with the value of the setting,
typically `:type`. This worked previously in Rails 3.2.
2014-01-14 18:53:45 +05:30
Godfrey Chan
b242b2dbe7 Enum mappings are now exposed via class methods instead of constants.
Example:

    class Conversation < ActiveRecord::Base
      enum status: [ :active, :archived ]
    end

Before:

    Conversation::STATUS # => { "active" => 0, "archived" => 1 }

After:

    Conversation.statuses # => { "active" => 0, "archived" => 1 }
2014-01-14 04:00:34 -08:00
Carlos Antonio da Silva
028029c1b6 Merge pull request #13705 from mess110/controller_generator_route_quotes
Single quotes for controller generated routes. This is more consistent with all other Rails generated code.
2014-01-14 02:13:28 -08:00
Yves Senn
c2a6fc42d2 Merge pull request #13706 from prathamesh-sonpatki/issue-13125
Fix fields_for documentation with index option [ci skip]
2014-01-14 01:16:34 -08:00
Prathamesh Sonpatki
3cf5d2b75b Fix fields_for documentation with index option [ci skip]
- fields_for documentation with index option was wrong.
- It does not work with passing model as it is.
- Changed the example by passing id of the address object.
- Fixes #13125.
2014-01-14 14:38:07 +05:30
Yves Senn
d901699aca Merge pull request #13709 from akshay-vishnoi/typo
[ci skip] Grammar correction
2014-01-14 00:29:32 -08:00
Yves Senn
66f3d5bd5a quick pass through Active Record CHANGELOG. [ci skip] 2014-01-14 09:19:37 +01:00
Akshay Vishnoi
a71a8e2a35 [ci skip] Grammar correction 2014-01-14 13:43:47 +05:30
Yves Senn
f6ca00bd43 Merge pull request #13669 from chulkilee/name-error-name
Set NameError#name
2014-01-14 00:12:54 -08:00
Damien Mathieu
58730361b3 Merge pull request #13707 from udaykadaboina/docModification
[ci skip] Added alias to CSRF
2014-01-13 23:48:38 -08:00
Cristian Mircea Messel
9cdc7c0614 single quotes for controller generated routes
Write routes in route.rb with single quotes

    get 'welcome/index'

instead of

    get "welcome/index"
2014-01-14 09:31:51 +02:00
Uday Kadaboina
ad04c2e0b5 [ci skip] Added alias to CSRF 2014-01-14 01:31:23 -05:00
Aaron Patterson
f1764a2de1 unscope should remove bind values associated with the where 2014-01-13 16:15:20 -08:00
Aaron Patterson
1e2d7c2de2 reverse_order_value= is not private, so no need to send
It's not public API, but is not private scoped.
2014-01-13 16:10:57 -08:00
Aaron Patterson
81d10b9add avoid more dynamic symbols 2014-01-13 15:25:47 -08:00
Aaron Patterson
492bad71f3 no need to to_sym 2014-01-13 15:11:19 -08:00
Rafael Mendonça França
7e02effa7a Merge pull request #13704 from waynn/patch-4
"serie" => "series"
2014-01-13 15:10:45 -08:00
Aaron Patterson
d220e8add9 recover from test runs that leave the database in a bad state 2014-01-13 15:02:28 -08:00
Xavier Noria
e992cd4d91 updates screenshot data [ci skip] 2014-01-13 23:32:04 +01:00
Waynn Lue
fd68adc8a9 "serie" => "series" 2014-01-13 14:23:58 -08:00
Xavier Noria
7524a9166c revises a few things in the getting started guide [ci skip]
More to come.
2014-01-13 23:11:44 +01:00
Chulki Lee
bea44cbaa4 Set NameError#name 2014-01-13 12:47:14 -08:00
Rafael Mendonça França
8b70319c27 Merge pull request #13703 from schneems/schneems/rail-secrets-key
Favor canonical environment variables for secrets
2014-01-13 12:33:04 -08:00
schneems
b9095ec95c Favor canonical environment variables for secrets
Prefixing an environment variable with `RAILS_` should be used when there is otherwise a conflict, such as `RAILS_ENV` or if it is being used for a very Rails specific value.

If we remove the prefix of `RAILS_` in the case of `RAILS_SECRET_KEY_BASE` then we can push for a pseudo standard among other frameworks that will accept a common environment key `SECRET_KEY_BASE` to keep your app secure. This is beneficial for containerized deployments such as docker, Heroku, etc. So that the container need to know one less thing about your app (it can just set it no-matter what language or framework you are using). 

This change also allows the defaults to be consistent with the way the secret key is accessed so `secrets.secret_key_base` is aliased to `SECRET_KEY_BASE` instead of `RAILS_SECRET_KEY_BASE`.
2014-01-13 14:31:43 -06:00
Rafael Mendonça França
fe24a383d1 Merge pull request #13702 from kuldeepaggarwal/docs-fix
removed extra comma [ci skip]
2014-01-13 11:52:01 -08:00
Kuldeep Aggarwal
1ea0ae6637 removed extra comma [ci skip] 2014-01-14 01:18:00 +05:30
Yves Senn
e0a521cfcd Only lookup config.log_level for stdlib ::Logger. Closes #11665.
This prevents Rails from assigning meaningless log levels to third
party loggers like log4r. If `Rails.logger` is not `kind_of?(::Logger)`
we simply assign the `config.log_level` as is.

This bug was introduced by #11665.
2014-01-13 19:00:45 +01:00
Rafael Mendonça França
4f779e32d8 Merge pull request #13699 from rystraum/dependent-restrict-removal
Updated Changelog to reflect removal of :dependent => :restrict
2014-01-13 09:46:50 -08:00
Rystraum Gamonez
25a9623422 Updated Changelog to reflect removal of :dependent => :restrict
Based on https://github.com/rails/rails/issues/2502, the option has
been removed.
2014-01-14 01:29:26 +08:00
Yves Senn
050f100d07 Merge pull request #13693 from gaurish/typo
[JRuby] Fix incorrect RUBY_ENGINE value
2014-01-13 06:33:25 -08:00
Gaurish Sharma
35e56f6fa5 standardize on jruby_skip & rbx_skip
This Adds helpers(jruby_skip & rbx_skip). In Future, Plan is to use
these helpers instead of calls directly to
RUBY_ENGINE/RbConfig/JRUBY_VERSION
2014-01-13 19:51:47 +05:30
Yves Senn
e95031f55d fix bug in becomes! when changing from base to subclass. Closes #13272. 2014-01-13 15:07:14 +01:00
Yves Senn
ee4b5f1b8a highlight http://localhost:3000 in README.md. Closes #13643. [ci skip]
This has no effect on the API docs. The main API page is taken from:
    railties/RDOC_MAIN.rdoc
2014-01-13 11:50:22 +01:00
Yves Senn
8c0d5e0d1c doc proc/lambda arg on inclusion validation. Closes #13689. [ci skip] 2014-01-13 11:25:58 +01:00
Yves Senn
3a521bc7d1 Merge pull request #13687 from gaurish/spring-has-no-love-for-jruby
Skip Spring App Generator tests on JRuby
2014-01-12 23:44:36 -08:00
Godfrey Chan
2b4ed72225 Merge pull request #13646 from jenseng/json_escape
Clarify behavior of json_escape [ci skip]
2014-01-12 20:50:38 -08:00