Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 104 lines (68 sloc) 3.298 kb
b296799 @nerdcave ensure `method_missing` called for non-existing methods passed to
nerdcave authored
1 * Ensure `method_missing` is called for methods passed to
2 `ActiveModel::Serialization#serializable_hash` that don't exist.
3
4 *Jay Elaraj*
5
f072db8 @fertapric Add `ActiveModel::Dirty#[attr_name]_previously_changed?` and
fertapric authored
6 * Add `ActiveModel::Dirty#[attr_name]_previously_changed?` and
7 `ActiveModel::Dirty#[attr_name]_previous_change` to improve access
8 to recorded changes after the model has been saved.
9
10 It makes the dirty-attributes query methods consistent before and after
11 saving.
12
13 *Fernando Tapia Rico*
14
1c341eb @sgrif Deprecate the `:tokenizer` option to `validates_length_of`
sgrif authored
15 * Deprecate the `:tokenizer` option for `validates_length_of`, in favor of
16 plain Ruby.
17
18 *Sean Griffin*
19
fd38838 @morgoth Deprecate `ActiveModel::Errors` `add_on_empty` and `add_on_blank` met…
morgoth authored
20 * Deprecate `ActiveModel::Errors#add_on_empty` and `ActiveModel::Errors#add_on_blank`
21 with no replacement.
22
23 *Wojciech Wnętrzak*
24
6ec8ba1 @morgoth Deprecate `ActiveModel::Errors` `get`, `set` and `[]=` methods.
morgoth authored
25 * Deprecate `ActiveModel::Errors#get`, `ActiveModel::Errors#set` and
26 `ActiveModel::Errors#[]=` methods that have inconsistent behaviour.
27
28 *Wojciech Wnętrzak*
29
cdbf685 @senny pass over CHANGELOGs. [ci skip]
senny authored
30 * Allow symbol as values for `tokenize` of `LengthValidator`.
c3fa5c3 @kakipo Allow symbol as values for `tokenize` of `LengthValidator`
kakipo authored
31
32 *Kensuke Naito*
33
5bdb421 @egilburg use attribute assignment module logic during active model initialization
egilburg authored
34 * Assigning an unknown attribute key to an `ActiveModel` instance during initialization
35 will now raise `ActiveModel::AttributeAssignment::UnknownAttributeError` instead of
e71f5da @senny some indenting and punctuation fixes. [ci skip]
senny authored
36 `NoMethodError`.
5bdb421 @egilburg use attribute assignment module logic during active model initialization
egilburg authored
37
afe402d @senny unify CHANGELOG format. [ci skip]
senny authored
38 Example:
39
40 User.new(foo: 'some value')
41 # => ActiveModel::AttributeAssignment::UnknownAttributeError: unknown attribute 'foo' for User.
5bdb421 @egilburg use attribute assignment module logic during active model initialization
egilburg authored
42
43 *Eugene Gilburg*
44
2606fb3 @bogdan Extracted `ActiveRecord::AttributeAssignment` to `ActiveModel::Attrib…
bogdan authored
45 * Extracted `ActiveRecord::AttributeAssignment` to `ActiveModel::AttributeAssignment`
afe402d @senny unify CHANGELOG format. [ci skip]
senny authored
46 allowing to use it for any object as an includable module.
47
48 Example:
49
50 class Cat
51 include ActiveModel::AttributeAssignment
52 attr_accessor :name, :status
53 end
54
55 cat = Cat.new
56 cat.assign_attributes(name: "Gorby", status: "yawning")
9cc41c3 @robin850 Fix a few typos [ci skip]
robin850 authored
57 cat.name # => 'Gorby'
58 cat.status # => 'yawning'
afe402d @senny unify CHANGELOG format. [ci skip]
senny authored
59 cat.assign_attributes(status: "sleeping")
9cc41c3 @robin850 Fix a few typos [ci skip]
robin850 authored
60 cat.name # => 'Gorby'
61 cat.status # => 'sleeping'
2606fb3 @bogdan Extracted `ActiveRecord::AttributeAssignment` to `ActiveModel::Attrib…
bogdan authored
62
63 *Bogdan Gusiev*
64
cb74473 @morgoth Add ActiveModel::Errors#details
morgoth authored
65 * Add `ActiveModel::Errors#details`
66
67 To be able to return type of used validator, one can now call `details`
afe402d @senny unify CHANGELOG format. [ci skip]
senny authored
68 on errors instance.
69
70 Example:
71
72 class User < ActiveRecord::Base
73 validates :name, presence: true
74 end
75
76 user = User.new; user.valid?; user.errors.details
77 => {name: [{error: :blank}]}
cb74473 @morgoth Add ActiveModel::Errors#details
morgoth authored
78
79 *Wojciech Wnętrzak*
80
140557e @mokhan allow '1' or true for acceptance validation.
mokhan authored
81 * Change validates_acceptance_of to accept true by default.
82
83 The default for validates_acceptance_of is now "1" and true.
cb74473 @morgoth Add ActiveModel::Errors#details
morgoth authored
84 In the past, only "1" was the default and you were required to add
140557e @mokhan allow '1' or true for acceptance validation.
mokhan authored
85 accept: true.
86
37175a2 @rafaelfranca Remove deprecated `ActiveModel::Dirty#reset_#{attribute}` and `Active…
rafaelfranca authored
87 * Remove deprecated `ActiveModel::Dirty#reset_#{attribute}` and
88 `ActiveModel::Dirty#reset_changes`.
89
90 *Rafael Mendonça França*
91
9c65c53 @claudiob Add config to halt callback chain on return false
claudiob authored
92 * Change the way in which callback chains can be halted.
93
94 The preferred method to halt a callback chain from now on is to explicitly
95 `throw(:abort)`.
96 In the past, returning `false` in an ActiveModel or ActiveModel::Validations
97 `before_` callback had the side effect of halting the callback chain.
98 This is not recommended anymore and, depending on the value of the
99 `config.active_support.halt_callback_chains_on_return_false` option, will
100 either not work at all or display a deprecation warning.
f767981 @claudiob Deprecate `false` as the way to halt AM validation callbacks
claudiob authored
101
102
f25ad07 @rafaelfranca Start Rails 5 development :tada:
rafaelfranca authored
103 Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activemodel/CHANGELOG.md) for previous changes.
Something went wrong with that request. Please try again.