activemodel 4.0.3 → 4.0.4.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bd3bc22950a065eac891deacf585d47164b4bac
4
- data.tar.gz: 51e09147c68f35b7f41df882351b43d09946129b
3
+ metadata.gz: a816ecc3d18076ab63730be05196adc8ff854e92
4
+ data.tar.gz: 8a0a6ef882727c2de169de462d85fdc7ae7c180f
5
5
  SHA512:
6
- metadata.gz: 21fa30fcbc214bf4de549a6a6395bf7754bc0bc9e737f24de0a5f4b16520e1b68f7703907a3b2b09e1e13e7c3bd4d15b3f0d53e2236baadef1f16ddd7306e04c
7
- data.tar.gz: 9057563326bbb4c1a0c3c17a18a97dcea845a154a56c1484f6c24ea15a0fb1f19c0744b4dab4112686ce0c8081f1ac3c2a28965853049568e8a9678952154653
6
+ metadata.gz: 7263d900a354401b223783b6be71c98a17c02a8b104be7f3ca8fa38afaffbe70af921341f472f7f402f3c6269c3b97e52aee9343a37bde0e07cfb35e2ce08b45
7
+ data.tar.gz: ab20a034845611352398a2334851c444ee1d90f71138b076caf74fc39f6d5a5cc6b0ca0baca957c2fbf7bbb2454972a83d5291ee95ad42959bbdf0f273a2f455
@@ -1,3 +1,20 @@
1
+ ## Rails 4.0.4 ##
2
+
3
+ * `#to_param` returns `nil` if `#to_key` returns `nil`. Fixes #11399.
4
+
5
+ *Yves Senn*
6
+
7
+
8
+ ## Rails 4.0.3 (February 18, 2014) ##
9
+
10
+ *No changes*
11
+
12
+
13
+ ## Rails 4.0.2 (December 02, 2013) ##
14
+
15
+ *No changes*
16
+
17
+
1
18
  ## Rails 4.0.1 (November 01, 2013) ##
2
19
 
3
20
  * Fix `has_secure_password` to honor bcrypt-ruby's cost attribute.
@@ -60,9 +60,9 @@ module ActiveModel
60
60
  end
61
61
  end
62
62
 
63
- def eager_load!
63
+ def self.eager_load!
64
64
  super
65
- ActiveModel::Serializer.eager_load!
65
+ ActiveModel::Serializers.eager_load!
66
66
  end
67
67
  end
68
68
 
@@ -62,7 +62,7 @@ module ActiveModel
62
62
  # person = Person.create
63
63
  # person.to_param # => "1"
64
64
  def to_param
65
- persisted? ? to_key.join('-') : nil
65
+ (persisted? && key = to_key) ? key.join('-') : nil
66
66
  end
67
67
 
68
68
  # Returns a +string+ identifying the path associated with the object.
@@ -262,10 +262,10 @@ module ActiveModel
262
262
  # namespaced models regarding whether it's inside isolated engine.
263
263
  #
264
264
  # # For isolated engine:
265
- # ActiveModel::Naming.singular_route_key(Blog::Post) #=> post
265
+ # ActiveModel::Naming.singular_route_key(Blog::Post) #=> "post"
266
266
  #
267
267
  # # For shared engine:
268
- # ActiveModel::Naming.singular_route_key(Blog::Post) #=> blog_post
268
+ # ActiveModel::Naming.singular_route_key(Blog::Post) #=> "blog_post"
269
269
  def self.singular_route_key(record_or_class)
270
270
  model_name_from_record_or_class(record_or_class).singular_route_key
271
271
  end
@@ -274,10 +274,10 @@ module ActiveModel
274
274
  # namespaced models regarding whether it's inside isolated engine.
275
275
  #
276
276
  # # For isolated engine:
277
- # ActiveModel::Naming.route_key(Blog::Post) #=> posts
277
+ # ActiveModel::Naming.route_key(Blog::Post) #=> "posts"
278
278
  #
279
279
  # # For shared engine:
280
- # ActiveModel::Naming.route_key(Blog::Post) #=> blog_posts
280
+ # ActiveModel::Naming.route_key(Blog::Post) #=> "blog_posts"
281
281
  #
282
282
  # The route key also considers if the noun is uncountable and, in
283
283
  # such cases, automatically appends _index.
@@ -289,10 +289,10 @@ module ActiveModel
289
289
  # namespaced models regarding whether it's inside isolated engine.
290
290
  #
291
291
  # # For isolated engine:
292
- # ActiveModel::Naming.param_key(Blog::Post) #=> post
292
+ # ActiveModel::Naming.param_key(Blog::Post) #=> "post"
293
293
  #
294
294
  # # For shared engine:
295
- # ActiveModel::Naming.param_key(Blog::Post) #=> blog_post
295
+ # ActiveModel::Naming.param_key(Blog::Post) #=> "blog_post"
296
296
  def self.param_key(record_or_class)
297
297
  model_name_from_record_or_class(record_or_class).param_key
298
298
  end
@@ -18,9 +18,9 @@ module ActiveModel
18
18
  # value to the password_confirmation attribute and the the validation
19
19
  # will not be triggered.
20
20
  #
21
- # You need to add bcrypt-ruby (~> 3.1.2) to Gemfile to use #has_secure_password:
21
+ # You need to add bcrypt (~> 3.1.7) to Gemfile to use #has_secure_password:
22
22
  #
23
- # gem 'bcrypt-ruby', '~> 3.1.2'
23
+ # gem 'bcrypt', '~> 3.1.7'
24
24
  #
25
25
  # Example using Active Record (which automatically includes ActiveModel::SecurePassword):
26
26
  #
@@ -40,14 +40,13 @@ module ActiveModel
40
40
  # User.find_by(name: 'david').try(:authenticate, 'notright') # => false
41
41
  # User.find_by(name: 'david').try(:authenticate, 'mUc3m00RsqyRe') # => user
42
42
  def has_secure_password(options = {})
43
- # Load bcrypt-ruby only when has_secure_password is used.
43
+ # Load bcrypt gem only when has_secure_password is used.
44
44
  # This is to avoid ActiveModel (and by extension the entire framework)
45
45
  # being dependent on a binary library.
46
46
  begin
47
- gem 'bcrypt-ruby', '~> 3.1.2'
48
47
  require 'bcrypt'
49
48
  rescue LoadError
50
- $stderr.puts "You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install"
49
+ $stderr.puts "You don't have bcrypt installed in your application. Please add it to your Gemfile and run bundle install"
51
50
  raise
52
51
  end
53
52
 
@@ -29,7 +29,8 @@ module ActiveModel
29
29
  # * <tt>:in</tt> - An enumerable object of available items. This can be
30
30
  # supplied as a proc, lambda or symbol which returns an enumerable. If the
31
31
  # enumerable is a numerical range the test is performed with <tt>Range#cover?</tt>,
32
- # otherwise with <tt>include?</tt>.
32
+ # otherwise with <tt>include?</tt>. When using a proc or lambda the instance
33
+ # under validation is passed as an argument.
33
34
  # * <tt>:within</tt> - A synonym(or alias) for <tt>:in</tt>
34
35
  # * <tt>:message</tt> - Specifies a custom error message (default is: "is
35
36
  # not included in the list").
@@ -13,7 +13,7 @@ module ActiveModel
13
13
  # validates :terms, acceptance: true
14
14
  # validates :password, confirmation: true
15
15
  # validates :username, exclusion: { in: %w(admin superuser) }
16
- # validates :email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, on: :create }
16
+ # validates :email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create }
17
17
  # validates :age, inclusion: { in: 0..9 }
18
18
  # validates :first_name, length: { maximum: 30 }
19
19
  # validates :age, numericality: true
@@ -61,7 +61,7 @@ module ActiveModel
61
61
  # end
62
62
  #
63
63
  # Note that the validator is initialized only once for the whole application
64
- # lifecycle, and not on each validation run.
64
+ # life cycle, and not on each validation run.
65
65
  #
66
66
  # The easiest way to add custom validators for validating individual attributes
67
67
  # is with the convenient <tt>ActiveModel::EachValidator</tt>.
@@ -1,7 +1,7 @@
1
1
  module ActiveModel
2
2
  # Returns the version of the currently loaded ActiveModel as a Gem::Version
3
3
  def self.version
4
- Gem::Version.new "4.0.3"
4
+ Gem::Version.new "4.0.4.rc1"
5
5
  end
6
6
 
7
7
  module VERSION #:nodoc:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.3
19
+ version: 4.0.4.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.3
26
+ version: 4.0.4.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -99,12 +99,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  version: 1.9.3
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - ">"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: 1.3.1
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.2.0
107
+ rubygems_version: 2.2.2
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: A toolkit for building modeling frameworks (part of Rails).