Commit Graph

1154 Commits

Author SHA1 Message Date
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
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
Vijay Dev
cb524dc1d7 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
2012-09-09 17:38:47 +05:30
Carlos Antonio da Silva
29fe06577f Bump builder dependencies in Active Model and Action Pack 2012-09-07 13:13:39 -03:00
Carlos Antonio da Silva
0180e090ab Update Active Model xml serialization test to reflect a change in builder
Due to a change in builder, nil values and empty strings now generates
closed tags, so instead of this:

    <pseudonyms nil=\"true\"></pseudonyms>

It generates this:

    <pseudonyms nil=\"true\"/>

Document this change in Rails so that people can track it down easily if
necessary.
2012-09-07 13:08:30 -03:00
Anatoly Makarevich
fce0d088a5 Added forgotten :message option to ActiveModel validates documentation 2012-09-07 14:56:23 +04:00
Xavier Noria
810a50dacf CHANGELOGs are now per branch
Changes in old branches needed to be manually synched in CHANGELOGs of newer ones.
This has proven to be brittle, sometimes one just forgets this manual step.
With this commit we switch to CHANGELOGs per branch. When a new major version is
cut from master, the CHANGELOGs in master start being blank.

A link to the CHANGELOG of the previous branch allows anyone interested to
follow the history.
2012-08-28 21:15:16 +02:00
kennyj
9063f3729b Fix method redefined warnings. 2012-08-29 02:38:12 +09:00
Gabriel Sobrinho
2f3eb484f2 Accept a symbol for :in option on inclusion and exclusion validators 2012-08-24 15:26:17 -03:00
Francesco Rodriguez
961957d570 Fix ActiveModel tests that depend on run order 2012-08-23 16:00:58 -05:00
José Valim
2801786e1a Get rid of config.preload_frameworks in favor of config.eager_load_namespaces
The new option allows any Ruby namespace to be registered and set
up for eager load. We are effectively exposing the structure existing
in Rails since v3.0 for all developers in order to make their applications
thread-safe and CoW friendly.
2012-08-21 14:47:19 -03:00
Rafael Mendonça França
cfd7f4e9a0 Merge pull request #7024 from bogdan/strict_validation_custom_exception
AM::Validation#validates: custom exception for :strict option

Conflicts:
	activemodel/CHANGELOG.md
2012-08-16 16:59:04 -03:00
Vijay Dev
176f0888d8 Merge branch 'master' of github.com:lifo/docrails 2012-08-16 00:07:17 +05:30
Anthony
78f5874c82 Following the false issue reporting I did here : https://github.com/rails/rails/issues/6958
- Enable propagation of :skip_types, :dasherize and :camelize on included models by default
- Adding the option to override this propagation on a per-include basis (:include => { :model => { :dasherize => false } }
- Enough tests to prove it works
- Updated activemodel CHANGELOG.md

Squashed my commits
2012-08-13 19:14:24 -07:00
Carlos Antonio da Silva
ce06b8a56c Refactor model name logic and make it a real private class method
Under a "private" call, class methods are not real private methods,
they're public just like any other method.

Make model_name_from_record_or_class a private class method, and nodoc it.
2012-08-11 13:33:28 -03:00
Rafael Mendonça França
8781b266b9 Sync CHANGELOGs [ci skip] 2012-08-11 13:13:58 -03:00