Commit Graph

1240 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
b3a31e9363 Fix AMo code example indent, add missing author to entry [ci skip] 2013-03-09 14:57:31 -03:00
Rafael Mendonça França
cf09ac380e Merge pull request #9545 from senny/9535_secure_password_blank
`has_secure_password` is not invalid when assigning empty Strings
2013-03-07 08:05:05 -08:00
Vijay Dev
6ea48ebfa6 Merge branch 'master' of github.com:lifo/docrails 2013-03-05 22:51:48 +05:30
Yves Senn
8c1687bbf8 has_secure_password is not invalid when assigning empty Strings.
Closes #9535.

With 692b3b6 the `password=` setter does no longer set blank passwords.
This triggered validation errors when assigning empty Strings to `password`
and `password_confirmation`.

This patch only sets the confirmation if it is not `blank?`.
2013-03-04 18:56:05 +01:00
Yves Senn
b501ee47fa validates_confirmation_of does not override writer methods. 2013-03-04 18:51:34 +01:00
Lebin Sebastian F
50b3b968d4 Small Typo 2013-03-04 13:23:23 +05:30
Rafael Mendonça França
0f75e2c51f Update CHANGELOGS 2013-02-26 13:45:57 -03:00
David Heinemeier Hansson
c0bc9ce38c Preparing for 4.0.0.beta1 release 2013-02-25 08:31:50 -06:00
Xavier Noria
05857ec30e did a pass over the AM changelog [ci skip] 2013-02-24 20:37:15 +01:00
Angelo capilleri
40c1ee8b7d added more accurate test for add_on_empty
with the current tests, if delete the assignment of is_empty in add_on_empty method
the tests not fail. With this test, if we delete is_empty, the test fails
2013-02-19 18:48:37 +01:00
Vijay Dev
0c145448c4 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	guides/source/upgrading_ruby_on_rails.md
2013-02-15 22:06:17 +05:30
Henrik Nyh
53c22e097a Clarify ActiveModel::Validator initialization in docs.
As discussed with @josevalim on Ruby Rogues Parley.
2013-02-09 15:54:14 +01:00
Rafael Mendonça França
e16110c4b8 Take care of whitespaces and changing the hash syntax 2013-02-04 09:59:22 -02:00
David
6e2cba1c8b test for issue 8931 2013-02-02 13:00:52 +08:00
Akira Matsuda
ee4a2bb23d Missing require extract_options 2013-01-31 23:45:36 +09:00
Attila Domokos
69b6129fd4 Adding the route_key and param_key tests
This way all the tests are testing the same fields
2013-01-22 22:13:43 -05:00
Guillermo Iguaran
8aebe30ef4 Revert "Merge pull request #8989 from robertomiranda/use-rails-4-find-by"
This reverts commit 637a7d9d357a0f3f725b0548282ca8c5e7d4af4a, reversing
changes made to 5937bd02dee112646469848d7fe8a8bfcef5b4c1.
2013-01-18 09:15:19 -05:00
robertomiranda
7baecc4802 User Rails 4 find_by 2013-01-18 07:56:05 -05:00
Carlos Antonio da Silva
203f787321 Merge pull request #8940 from adomokos/adding_tests_for_changed_attributes
Cleaning up ActiveModel::Dirty tests
2013-01-15 13:02:57 -08:00
Attila Domokos
63333e600f Cleaning up ActiveModel::Dirty tests
* Clarifying what the #changed method returns
* Adding tests to describe what the #changed_attributes returns
* Updating test name based on pull request comment
* Moving the test lower in the file per pull request comment
2013-01-15 10:24:57 -05:00
Trung Lê
86c4fe8191 ActiveRecord <-> Active Record [ci skip] 2013-01-15 10:52:02 +00:00
Yves Senn
bc19c0d09c test for ActiveModel::Conversion#to_partial_path and namespaced models 2013-01-14 21:17:22 +01:00
Attila Domokos
01434a5ee6 Adding tests for ActiveModel::Model
* Verifying persisted? is false when Model initialized
* Passing nil to Model should not blow up
* Changing test name to the one suggested in pull request comment
2013-01-12 20:04:24 -05:00
Attila Domokos
7171f9cc8f Covering untested methods for ActiveModel::Errors 2013-01-10 21:41:35 -05:00
Irio Irineu Musskopf Junior
d4f46ee4fd Set default value to ActiveModel::Validator initializer attribute
Makes it easier to test its objects.
2013-01-09 13:50:27 -02:00
Vijay Dev
f049016cd3 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	guides/source/getting_started.md
2013-01-09 01:04:15 +05:30
Gosha Arinich
0acf92184d prefer american spelling of 'behavior' 2013-01-07 11:47:27 +03:00
Akira Matsuda
3c21237c37 Reduce number of Strings a bit 2013-01-07 07:37:23 +09:00
Akira Matsuda
c8e632bd9f Namespace HashWithIndifferentAccess 2013-01-07 07:37:23 +09:00
Akira Matsuda
7f495993bb Observers was extracted from Active Model as rails-observers gem 2013-01-02 06:23:12 +09:00
Andrew Nesbitt
d814284506 Updated copyright notices for 2013 2012-12-31 20:35:29 +00:00
Rafael Mendonça França
5da4d5142a Add active_support/testing/autorun
minitest/autorun load minitest/spec polluting the global namespace with
the DSL that we don't want on Rails
2012-12-31 13:57:24 -03:00
Rafael Mendonça França
b05819fd28 This change doesn't need a CHANGELOG entry.
[ci skip]
2012-12-26 20:39:32 -03:00
Rafael Mendonça França
9647d4b6f4 Add CHANGELOG entry for #8622 2012-12-26 19:22:38 -03:00
Rafael Mendonça França
78fd14c8de Revert the change at ActiveModel::Errors#add_on_blank and fix in the
right place.

The EachValidator#validate already handle :allow_blank and :allow_nil,
correctly.

Closes #8622.

Fix #8621.
2012-12-26 18:55:47 -03:00
Colin Kelley
d4c30a0226 Tests and fix for validates_presence of :allow_nil, :allow_blank
Conflicts:
	activemodel/lib/active_model/errors.rb
2012-12-26 18:19:27 -03:00
Akira Matsuda
08cf17d708 chmod -x from non-script files 2012-12-24 23:36:19 +09:00
Rafael Mendonça França
bda1937f28 Remove CHANGELOG entry for ActiveModel::Errors#add_on_present 2012-12-21 17:10:41 -03:00
Rafael Mendonça França
ac6941fb71 Use :present as key for the absence validatior message 2012-12-21 17:10:16 -03:00
Rafael Mendonça França
b437053b5b Remove ActiveModel::Errors#add_on_present method.
We don't need to define a new method in ActiveMode::Errors for each
validatior.

See
d72a07f1d1 (commitcomment-2325333)
2012-12-21 17:06:18 -03:00
Carlos Antonio da Silva
42b555dcf3 Fix Action Mailer changelog indenation to match other changelogs
Also some minor improvements to other changelogs. [ci skip]
2012-12-19 23:09:04 -02:00
Carlos Antonio da Silva
05b80a1cce Improve AMo changelog example to not rely on AR [ci skip] 2012-12-19 23:03:32 -02:00
Roberto Vasquez Angel
d72a07f1d1 Add ActiveModel::Validations::AbsenceValidator, a validator to check the absence of attributes.
Add `ActiveModel::Errors#add_on_present` method. Adds error messages to present attributes.
2012-12-15 16:27:44 -05:00
Carlos Antonio da Silva
df9f9b7f3e Convert changelogs to 1.9 hash style and fix some formatting [ci skip] 2012-12-14 20:25:22 -02:00
Aaron Patterson
49219293e5 Merge pull request #8510 from thedarkone/thread_safety_improvements
Thread safety improvements
2012-12-14 11:12:50 -08:00
thedarkone
45448a5788 Replace some global Hash usages with the new thread safe cache.
Summary of the changes:
 * Add thread_safe gem.
 * Use thread safe cache for digestor caching.
 * Replace manual synchronization with ThreadSafe::Cache in Relation::Delegation.
 * Replace @attribute_method_matchers_cache Hash with ThreadSafe::Cache.
 * Use TS::Cache to avoid the synchronisation overhead on listener retrieval.
 * Replace synchronisation with TS::Cache usage.
 * Use a preallocated array for performance/memory reasons.
 * Update the controllers cache to the new AS::Dependencies::ClassCache API.
   The original @controllers cache no longer makes much sense after @tenderlove's
   changes in 7b6bfe84f3 and f345e2380c.
 * Use TS::Cache in the connection pool to avoid locking overhead.
 * Use TS::Cache in ConnectionHandler.
2012-12-14 12:18:47 +01:00
Andrew White
4dd5635922 Only call in_time_zone on Time or DateTime instances
Both String and Date now respond to in_time_zone so we need to
check if the value is a Time or a DateTime.
2012-12-11 12:35:30 +00:00
Jeremy Kemper
8110035623 Revert "Omit directories from gemspec.files for RubyGems 2 compat."
Obviated by rubygems/rubygems@486ed83cc8

This reverts commit bb8923dee093b615615cdfb83b34d1b0bb254f25.
2012-12-09 17:14:27 -07:00
Jeremy Kemper
bb8923dee0 Omit directories from gemspec.files for RubyGems 2 compat.
RG2 packager expects each spec.files path to be a file and bombs when it tries to tarball a dir.

May revert if rubygems/rubygems#413 is accepted.
2012-12-08 17:18:46 -07:00
claudiob
019df98875 Replace comments' non-breaking spaces with spaces
Sometimes, on Mac OS X, programmers accidentally press Option+Space
rather than just Space and don’t see the difference. The problem is
that Option+Space writes a non-breaking space (0XA0) rather than a
normal space (0x20).

This commit removes all the non-breaking spaces inadvertently
introduced in the comments of the code.
2012-12-04 22:11:54 -08:00