Commit Graph

1168 Commits

Author SHA1 Message Date
Trevor Turk
06faa6da80 Use BCrypt's MIN_COST in the test environment for speedier tests 2012-11-14 09:42:54 -06:00
Dennis Taylor
ba291a67df Trivial documentation fix for ActiveModel::Naming comment. 2012-11-09 11:23:51 -08:00
Aaron Patterson
72f5085404 rm dead code 2012-11-09 10:31:23 +09:00
Vinny Diehl
a96a176930 Clean up gemspecs
Organized the gemspec files a bit.

 * Made quotes more consistent (single quotes dominated, so I used
   that).
 * Moved license line down a line, separating it logically, and removed
   the extra whitespace before its = operator.
 * Minor whitespace fixes.
2012-11-08 19:09:43 -05:00
Vasiliy Ermolovich
70ecf6c518 use Array() instead flatten
* move ActiveModel::Errors tests to errors_test.rb
* add spec coverage for add_on_empty and add_on_blank
2012-11-05 18:29:31 +03:00
Carlos Antonio da Silva
b1fe78e0cb Raise ArgumentError when no attribute is given to AMo::EachValidator
ArgumentError is better suited than RuntimeError for this.
2012-11-04 11:41:05 -02:00
Carlos Antonio da Silva
d9f20c575a Set hash value instead of using merge! 2012-11-04 11:35:01 -02:00
Vijay Dev
3b0bb08699 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	actionpack/lib/action_controller/metal/mime_responds.rb
	activerecord/lib/active_record/attribute_methods.rb
	guides/source/working_with_javascript_in_rails.md
2012-11-03 01:56:16 +05:30
Alexey Gaziev
b955939d55 Make caller attribute in deprecation methods optional 2012-10-30 10:23:41 +08:00
Cédric FABIANSKI
3152ee878a Add test for code change introduced in this commit f20032f 2012-10-29 21:55:09 +01: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
Francesco Rodriguez
df2b60cd41 fix failing isolated tests 2012-10-26 23:03:36 -05:00
Francesco Rodriguez
10d9cb2052 fix AM::Serializers titles [ci skip] 2012-10-26 21:46:15 -05:00
Francesco Rodriguez
070329596f AM::Serializers::Xml depends on AM::Naming 2012-10-26 21:45:40 -05:00
Francesco Rodriguez
9ac095fef5 minor edits and remove mixed titles in AM::Validations docs [ci skip] 2012-10-25 20:41:35 -05:00
Francesco Rodriguez
2ef4d5ed5c fix output messages - docs [ci skip] 2012-10-22 14:27:55 -05:00
AvnerCohen
77eb1fb22d convert comments to 1.9 hash syntax 2012-10-22 19:34:24 +02:00
Vijay Dev
f938019da2 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activesupport/lib/active_support/core_ext/hash/slice.rb
	guides/source/active_support_core_extensions.md
2012-10-21 18:49:19 +05:30
Francesco Rodriguez
c9a88a2c26 minor edits in AM documentation [ci skip] 2012-10-21 01:26:01 -05:00
Hrvoje Šimić
aee07fe135 include serializers in ActiveModel::Serialization example 2012-10-19 17:24:34 +02:00
Hrvoje Šimić
2d2c82354f better examples in ActiveModel readme 2012-10-19 16:58:30 +02:00
Jan Berdajs
a774354dfe add credit to committer of pull request #6569 2012-10-18 16:29:17 +02:00
Francesco Rodriguez
f12244b6d7 remove non-breaking spaces [ci skip] 2012-10-18 01:23:26 -05:00
Yves Senn
a06012c81f active_model/validations requires necessary files to run 2012-10-18 07:44:41 +02:00
Yves Senn
f00b33e173 cleanup, replace non-breaking spaces with spaces 2012-10-18 07:44:41 +02:00
dfens
ab9140ff02 Cleanup trailing whitespaces 2012-10-12 09:56:39 +02:00
Vijay Dev
f638ef951b Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activerecord/lib/active_record/persistence.rb
	railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb
2012-10-11 01:05:14 +05:30
Vijay Dev
43f32f2f5d Revert "Fix Example in active model attribute methods"
This reverts commit 1c02b988641c201308e6b3de6457128878e47bd5.
2012-10-11 00:43:52 +05:30
Vijay Dev
d5802adf83 Revert "Fix all examples in comments in active_model attribute methods"
This reverts commit 93b1ca8bd34993f8958219f13c195f5acf8e55f6.
2012-10-11 00:43:17 +05:30
Robin Dupret
f839e619d4 Use a 1.9 Hash syntax in README files (fixes thanks to @vijaydev) 2012-10-10 15:14:03 +02:00
Rafael Mendonça França
d56b5dacb1 Use the flat_map method.
Thanks to @jeremy to teach me this one.
2012-10-03 00:17:10 -03:00
Rafael Mendonça França
86062005a7 Revert "Merge pull request #7826 from sikachu/master-validators-kind"
This reverts commit 4e9f53f9736544f070e75e516c71137b7eb49a7a, reversing
changes made to 6b802cdb4f5b84e1bf49aaeb0e994b3be6028af9.

Revert "Don't use tap in this case."

This reverts commit 454d820bf0a18fe1db4c55b0145197d70fef1f82.

Reason: Is not a good idea to add options to this method since we can do
the same thing using method composition.

    Person.validators_on(:name).select { |v| v.kind == :presence }

Also it avoids to change the method again to add more options.
2012-10-02 23:57:00 -03:00
Rafael Mendonça França
454d820bf0 Don't use tap in this case.
The use of tap in this case is very confusing since we are mutating the
return value inside the block
2012-10-02 23:24:42 -03:00
Prem Sichanugrist
4f9b59dba0 Make .validators_on accept :kind option
This will filter out the validators on a particular attribute based on
its kind.
2012-10-02 22:09:06 -04:00
Nick Rowe
93b1ca8bd3 Fix all examples in comments in active_model attribute methods 2012-10-02 15:35:12 -07:00
Nick Rowe
1c02b98864 Fix Example in active model attribute methods 2012-10-02 15:18:08 -07:00
John Foley
60c65ca8df Switch to using include? on validation callbacks 2012-09-23 12:53:50 -06:00
John Foley
d66d6076b2 Fix collisions with before and after validation callbacks.
This commit allows a user to do something like:
    before_validation :do_stuff, :on => [ :create, :update ]
    after_validation :do_more, :on => [ :create, :update ]
2012-09-23 12:53:50 -06:00
Francesco Rodriguez
356eed9c60 add :nodoc: to AMo::DeprecatedMassAssignmentSecurity::ClassMethods [ci skip] 2012-09-20 12:18:59 -05:00
Francesco Rodriguez
6783c3f449 change AMo::ForbiddenAttributesProtection#sanitize_for_mass_assignment to protected 2012-09-20 12:18:59 -05:00
Francesco Rodriguez
1e56f1f14c update AMo::ForbiddenAttributesError documentation [ci skip] 2012-09-20 12:18:59 -05:00
Francesco Rodriguez
3759e32882 add :nodoc: directives to AMo::DeprecatedMassAssignmentSecurity [ci skip] 2012-09-20 12:18:58 -05:00
Guillermo Iguaran
1f4c89fbde Update changelogs to add entries about strong_parameters integration 2012-09-19 17:50:39 -05:00
Guillermo Iguaran
9bfa13bb06 attr_accessible and attr_protected raise an exception pointing to use plugin or new protection model 2012-09-16 23:58:21 -05:00
Guillermo Iguaran
8cfe95d719 Don't use assert_nothing_raised when assert_equal is used 2012-09-16 23:58:21 -05:00
Guillermo Iguaran
1fa4f9243d Rename ForbiddenAttributes exception to ForbiddenAttributesError 2012-09-16 23:58:21 -05:00
Guillermo Iguaran
52aa5343f4 Change AMo::ForbiddenAttributesProtection tests to use a subclass of Hash instead of monkey patch permitted? method in regular hashes 2012-09-16 23:58:19 -05:00
Guillermo Iguaran
f8c9a4d3e8 Remove MassAssignmentSecurity from ActiveModel
This will be moved out to protected_attributes gem
2012-09-16 23:58:19 -05:00
Guillermo Iguaran
a8f6d5c645 Integrate ActiveModel::ForbiddenAttributesProtection from StrongParameters gem 2012-09-16 23:58:19 -05:00
Nihad Abbasov
ab14392cbb remove '.rb' from require call 2012-09-12 12:48:17 +06:00