Rafael Mendonça França
6a6909dc29
Merge pull request #8084 from acapilleri/format_never_nil
...
if format is unknown NullMimeTypeObject is returned
2012-10-31 07:08:27 -07:00
Angelo capilleri
a8560fa361
if format is unknown NullMimeTypeObject is returned
...
If a unknown format is passed in a request, the methods html?, xml?, json? ...etc
Nil Exception.
This patch add a class NullMimeTypeObject, that is returned when request.format is unknown
and it responds false to the methods that ends with '?'.
It refers to #7837 , not fixes because it's not considered a improvement not a bug.
2012-10-31 15:07:37 +01:00
Carlos Antonio da Silva
6569709881
Merge pull request #8078 from nikitug/serialized_attributes_before_type_cast
...
Fix `attributes_before_type_cast` for serialized attributes.
2012-10-31 04:09:58 -07:00
Nikita Afanasenko
e7e59a75aa
Fix attributes_before_type_cast
for serialised attributes.
...
Public method `attributes_before_type_cast` used to return internal AR structure (ActiveRecord::AttributeMethods::Serialization::Attribute), patch fixes this. Now behaves like `read_attribute_before_type_cast` and returns unserialised values.
2012-10-31 13:16:44 +04:00
Rafael Mendonça França
85039d4b75
Merge pull request #8074 from kennyj/fix_6951
...
Fix #6951 . Use query cache/uncache, when using not only database.yml but also DATABASE_URL.
2012-10-30 18:27:40 -07:00
kennyj
a7c3c90250
Fix #6951 . Use query cache/uncache, when using not only database.yml but also DATABASE_URL.
2012-10-31 10:04:10 +09:00
Jon Leighton
7e17b0baec
Revert "Support Mailer.deliver_foo(*args)
as a synonym for Mailer.foo(*args).deliver
."
...
This reverts commit 7e0cf563639bc7508da381b1b8321c7a89be1aa8.
Conflicts:
actionmailer/CHANGELOG.md
See discussion at
7e0cf56363 (commitcomment-2075489)
2012-10-30 18:43:57 +00:00
Santiago Pastorino
e0fb16b92a
Revert "The debugger gem isn't compatible with 1.9.3-p286 yet. Omit it for now."
...
This reverts commit 7b290ad13c294005db062e746f8b79c8a192e4fa.
debugger gem is now working ok with p286
2012-10-30 16:42:51 -02:00
Carlos Antonio da Silva
48fe4f131b
Merge pull request #8072 from kennyj/remove_mattr_include_root_in_json
...
Allow include_root_in_json to be inheritable by using the class_attribute created by Active Model serialization module.
2012-10-30 08:22:14 -07:00
kennyj
fcd19a13b7
include_root_in_json allows inheritance.
2012-10-31 00:08:36 +09:00
Carlos Antonio da Silva
0ad6c08ca5
Merge pull request #6107 from gazay/make_caller_attribute_in_deprecation_optional
...
Make callstack attribute optional in AS:Deprecation
2012-10-30 03:47:07 -07:00
Alexey Gaziev
b955939d55
Make caller attribute in deprecation methods optional
2012-10-30 10:23:41 +08:00
Carlos Antonio da Silva
4e23c0ef34
Remove not assigned variable warning from sqlite3 adapter test
2012-10-29 23:51:25 -02:00
Rafael Mendonça França
3525a9b5eb
Fix bug when Column is trying to type cast boolean values to integer.
...
This can occur if the user is using :integer columns to store boolean
values. Now we are handling the boolean values but it still raises if
the value can't type cast to integer and is not a boolean. See #7509 .
Fixes #8067 .
Conflicts:
activerecord/CHANGELOG.md
2012-10-29 22:57:31 -02:00
Carlos Antonio da Silva
a4ac2b4d0a
Merge pull request #8066 from cfabianski/AddTestForSerializationMethod
...
Add test for code change introduced in this commit f20032f
2012-10-29 15:43:59 -07:00
Cédric FABIANSKI
3152ee878a
Add test for code change introduced in this commit f20032f
2012-10-29 21:55:09 +01:00
Carlos Antonio da Silva
008154e237
Fix failing tests and use new hash style in deprecation messages
2012-10-29 13:57:00 -02:00
Carlos Antonio da Silva
d1c95d912e
Merge pull request #8063 from nikitug/deprecation_caller_context
...
Provide a call stack for deprecation warnings where needed.
2012-10-29 08:42:16 -07:00
Nikita Afanasenko
0b7067d849
Provide a call stack for deprecation warnings where needed.
...
It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
2012-10-29 19:22:59 +04:00
Carlos Antonio da Silva
72e6fb005f
Fix deprecation message in test for Path#children
2012-10-29 12:53:32 -02:00
Rafael Mendonça França
29b1dc273e
Add test to deprecation of Path#children
2012-10-29 11:14:20 -02:00
Rafael Mendonça França
3663057518
Merge pull request #7587 from elia/fix-too-eager-loading
...
Should not eager_load app/assets
Conflicts:
railties/CHANGELOG.md
2012-10-29 11:14:14 -02:00
AvnerCohen
be4a4cd38f
Hash Syntax to 1.9 related changes
2012-10-29 13:10:53 +02:00
Juanjo Bazán
20c574ca85
Merge branch 'master' of github.com:lifo/docrails
2012-10-29 11:28:27 +01:00
Juanjo Bazán
0d7dcdcbf4
3.1 and up, in configuring guide.
2012-10-29 11:27:35 +01:00
Xavier Noria
71abfa511d
Merge pull request #8027 from daenney/master
...
Atomic.rb assumes it may chown/chmod a file but doesn't handle the EPERM error.
2012-10-29 02:17:11 -07:00
Daniele Sluijters
851f8c1023
atomicc.rb: Don't assume we may chown/chmod a file.
...
Previously this code just assumed it is capable of changing the file
ownership, both user and group. This will fail in a lot of scenario's
unless:
* The process is run as a superuser (root);
* The owning user and group are already set to the user and group we're
trying to chown to;
* The user chown'ing only changes the group to another group it is a
member of.
If either of those conditions are not met the filesystem will simply
deny the operation throwing an error.
It is also not always possible to do a chmod, there might be a SELinux
policy or another limitation preventing the user to change the file
mode. To this end the chmod call has also been added to the rescue
block.
I've also added a little comment above the chmod command that doing a
chmod on a file which has an ACL set will cause the ACL to be
recalculated / modified.
2012-10-29 10:04:59 +01:00
Rafael Mendonça França
81679ab2ae
Fix the skip code.
...
Checking for the constant doesn't work
2012-10-28 23:48:34 -02:00
Rafael Mendonça França
1743e95941
Merge pull request #8057 from frodsan/fix_sqlite_mutate_arg
...
SQLite3Adapter#type_cast should not mutate arguments
2012-10-28 17:01:01 -07:00
Stefan Rusterholz
b5133d018f
SQLite3Adapter#type_cast should not mutate arguments
2012-10-28 18:55:36 -05:00
Francesco Rodriguez
cd17ee5598
dont encourage AC::Parameters#permit_all_parameters usage [ci skip]
2012-10-28 17:51:28 -05:00
Rafael Mendonça França
852e376a51
Merge pull request #7750 from xuanxu/none_modificating_relation_in_place
...
Added ActiveRecord::Relation#none! method
2012-10-28 14:45:46 -07:00
Juanjo Bazán
300d080ada
ActiveRecord::Relation#none! method.
2012-10-28 22:18:45 +01:00
Juanjo Bazán
35ca953a27
loaded relations cannot be mutated by extending!
2012-10-28 22:17:34 +01:00
Carlos Antonio da Silva
c6f47c1980
Merge pull request #8053 from henrik/update_columns_with_primary_key
...
Unbreak update_column/update_columns for the primary key attribute.
2012-10-28 13:31:34 -07:00
Henrik N
1849665f73
Enable update_column(s) for the primary key attribute.
...
Didn't work before because it updated the model-in-memory first, so the DB query couldn't find the record.
2012-10-28 21:28:54 +01:00
Rafael Mendonça França
5bbe245a51
Merge pull request #8046 from pmahoney/exceptions_as_flow_control
...
Replace flow-control exception with explicit test.
2012-10-28 13:22:45 -07:00
Rafael Mendonça França
a273b6bd34
Merge pull request #8048 from senny/7761_dont_render_view_without_mail_call
...
Do not render views when mail() isn't called. (NullMail refactoring)
2012-10-28 12:55:53 -07:00
Carlos Antonio da Silva
a698175dfc
Merge pull request #8047 from arunagw/json_only_in_18
...
Removing JSON for other ruby
2012-10-28 17:54:58 -02:00
Carlos Antonio da Silva
d46f9e3731
Fix some assert_raise calls containing messages in Active Support
2012-10-28 17:54:24 -02:00
Carlos Antonio da Silva
ed80dd7a56
Merge pull request #8054 from senny/6378_create_table_raises_when_defining_pk_column
...
create_table raises an ArgumentError when the primary key is redefined.
2012-10-28 12:46:39 -07:00
Yves Senn
b786f065d3
Do not render views when mail() isn't called. (NullMail refactoring)
2012-10-28 20:45:43 +01:00
Yves Senn
e4790a2c5b
raise ArgumentError
when redefining the primary key column. Closes #6378
2012-10-28 20:40:37 +01:00
Yves Senn
b104157314
refactor SQLite3Adapter#copy_table
to prevent primary key redefinitions. #6378
2012-10-28 20:26:52 +01:00
Rafael Mendonça França
c82f0d76e4
Merge pull request #8056 from frodsan/fix_issue_missing_attribute
...
AR::AttributeMethods#[] raises AM::AttributeMissingError for missing attributes
2012-10-28 12:22:24 -07:00
Francesco Rodriguez
10f6f90d9d
AR::AttributeMethods#[] raises AM::AttributeMissingError for missing attributes.
...
This fixes the following behaviour:
class Person < ActiveRecord::Base
belongs_to :company
end
# Before:
person = Person.select('id').first
person[:name] # => nil
person.name # => ActiveModel::MissingAttributeError: missing_attribute: name
person[:company_id] # => nil
person.company # => nil
# After:
person = Person.select('id').first
person[:name] # => ActiveModel::MissingAttributeError: missing_attribute: name
person.name # => ActiveModel::MissingAttributeError: missing_attribute: name
person[:company_id] # => ActiveModel::MissingAttributeError: missing_attribute: company_id
person.company # => ActiveModel::MissingAttributeError: missing_attribute: company_id
Fixes #5433 .
2012-10-28 14:18:31 -05:00
Rafael Mendonça França
e46a8d89ba
Merge pull request #8052 from schneems/schneems/silence-ar-query-in-middleware
...
Don't log on pending migration check
2012-10-28 09:53:29 -07:00
schneems
0fbdddd715
Don't log on pending migration check
...
Conversation from: #6665 cc/ @rafaelfranca
2012-10-28 11:47:34 -05:00
Carlos Antonio da Silva
94aadf7680
Add syntax highlight to code blocks in javascript guide [ci skip]
2012-10-28 12:26:07 -02:00
Carlos Antonio da Silva
f47026e7f9
Add backticks around link_to example in javascript guide [ci skip]
2012-10-28 12:15:35 -02:00