- 06 1月, 2015 1 次提交
-
-
由 Prathamesh Sonpatki 提交于
- Fixtures with non-string labels such as integers should be accessed using integer label as key. For eg. pirates(1) or pirates(42). - But this results in NotFound error because the label is converted into string before looking up into the fixtures hash. - After this commit, the label is converted into string only if its a symbol. - This issue was fount out while adding a test case for https://github.com/rails/rails/commit/7b910917.
-
- 05 1月, 2015 6 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
由 Yves Senn 提交于
-
由 robertomiranda 提交于
Update SecureToken Docs Add Changelog entry for has_secure_token [ci skip]
-
- 04 1月, 2015 12 次提交
-
-
由 Rafael Mendonça França 提交于
Before this change we had a small set of "truthy", and all others are "falsy". Now, we have a small set of "falsy" values and all others are "truthy" matching Ruby's semantics.
-
由 Rafael Mendonça França 提交于
Before this change any error raised inside a transaction callback are rescued and printed in the logs. Now these errors are not rescue anymore and just bubble up, as the other callbacks.
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
Now all strings will be handled as a URL.
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
This reverts commit ae96f229. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/attribute_methods.rb
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
- 03 1月, 2015 2 次提交
-
-
由 claudiob 提交于
This stems from [a comment](rails#17227 (comment)) by @dhh. In summary: * New Rails 5.0 apps will not accept `return false` as a way to halt callback chains, and will not display a deprecation warning. * Existing apps ported to Rails 5.0 will still accept `return false` as a way to halt callback chains, albeit with a deprecation warning. For this purpose, this commit introduces a Rails configuration option: ```ruby config.active_support.halt_callback_chains_on_return_false ``` For new Rails 5.0 apps, this option will be set to `false` by a new initializer `config/initializers/callback_terminator.rb`: ```ruby Rails.application.config.active_support.halt_callback_chains_on_return_false = false ``` For existing apps ported to Rails 5.0, the initializers above will not exist. Even running `rake rails:update` will not create this initializer. Since the default value of `halt_callback_chains_on_return_false` is set to `true`, these apps will still accept `return true` as a way to halt callback chains, displaying a deprecation warning. Developers will be able to switch to the new behavior (and stop the warning) by manually adding the line above to their `config/application.rb`. A gist with the suggested release notes to add to Rails 5.0 after this commit is available at https://gist.github.com/claudiob/614c59409fb7d11f2931
-
由 claudiob 提交于
Before this commit, returning `false` in an ActiveRecord `before_` callback such as `before_create` would halt the callback chain. After this commit, the behavior is deprecated: will still work until the next release of Rails but will also display a deprecation warning. The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
-
- 02 1月, 2015 2 次提交
-
-
由 Ryuta Kamizono 提交于
Incompatible to rounding behavior between MySQL 5.6 and earlier. In 5.5, when you insert `2014-08-17 12:30:00.999999` the fractional part is ignored. In 5.6, it's rounded to `2014-08-17 12:30:01`: http://bugs.mysql.com/bug.php?id=68760
-
由 Ryuta Kamizono 提交于
-
- 31 12月, 2014 3 次提交
-
-
由 Rafael Mendonça França 提交于
This error only happens when the foreign key is missing. Before this fix the following exception was being raised: NoMethodError: undefined method `val' for #<Arel::Nodes::BindParam:0x007fc64d19c218> Now the message is: ActiveRecord::UnknownAttributeError: unknown attribute 'foreign_key' for Model.
-
由 Prathamesh Sonpatki 提交于
- Improved wording of CHANGELOG entry for https://github.com/arthurnn/rails/commit/5acd24bbeae0e9e5e81e87b5929e17f35527b2ea.
-
由 Arthur Neves 提交于
When table has a composite primary key, the `primary_key` method for sqlite3 and postgresql was only returning the first field of the key. Ensures that it will return nil instead, as AR dont support composite pks.
-
- 30 12月, 2014 3 次提交
-
-
由 Yves Senn 提交于
Closes #7247. Conflicts: activerecord/CHANGELOG.md activerecord/test/models/owner.rb
-
由 Sean Griffin 提交于
Fixes #18237
-
由 Takashi Kokubun 提交于
-
- 29 12月, 2014 2 次提交
-
-
由 Ryuta Kamizono 提交于
If it is not a default primary key, correctly dump the type and options.
-
由 Yves Senn 提交于
-
- 28 12月, 2014 4 次提交
-
-
由 Dan Olson 提交于
-
由 Sean Griffin 提交于
We only support classes which provide a no-args constructor to use as a default value. We can provide a more helpful error message if we catch this when `serialize` is called, rather than letting it error when you try to assign the attribute. Fixes #18224
-
由 Ryuta Kamizono 提交于
Example: create_table :foos, id: :bigint do |t| end
-
由 Ryuta Kamizono 提交于
-
- 26 12月, 2014 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 23 12月, 2014 4 次提交
-
-
由 Sean Griffin 提交于
Here you go, @senny.
😁 -
由 Yves Senn 提交于
-
由 Yves Senn 提交于
-
由 Daniel Fox 提交于
This bug occurs when an attribute of an ActiveRecord model is an ActiveRecord::Type::Integer type or a ActiveRecord::Type::Decimal type (or any other type that includes the ActiveRecord::Type::Numeric module. When the value of the attribute is negative and is set to the same negative value, it is marked as changed. Take the following example of a Person model with the integer attribute age: class Person < ActiveRecord::Base # age :integer(4) end The following will produce the error: person = Person.new(age: -1) person.age = -1 person.changes => { "age" => [-1, -1] } person.age_changed? => true The problematic line is here: module ActiveRecord module Type module Numeric ... def non_numeric_string?(value) # 'wibble'.to_i will give zero, we want to make sure # that we aren't marking int zero to string zero as # changed. value.to_s !~ /\A\d+\.?\d*\z/ end end end end The regex match doesn't accept numbers with a leading '-'.
-