Commit Graph

734 Commits

Author SHA1 Message Date
ayaya
c140a27fc5 fix alias_attribute will raise a syntax error if make an alias on a
column that named as a ruby keyword
2012-05-14 00:57:29 +08:00
Vijay Dev
42ff22f33a Merge branch 'master' of github.com:lifo/docrails 2012-05-01 19:06:03 +05:30
Edward Tsech
6e8f2be51a Add line which gives a little bit more information how *_will_change! works. 2012-05-01 13:52:21 +02:00
Marc-Andre Lafortune
dc74f0cb1b notify_observers should be public 2012-04-30 22:13:26 -04:00
Aaron Patterson
206b43a954 Merge pull request #6063 from marcandre/observer_extra_args
Allow extra arguments for Observers
2012-04-30 16:43:22 -07:00
Marc-Andre Lafortune
24c068d67d Allow extra arguments for Observers 2012-04-30 18:10:03 -04:00
Jeremy Kemper
0393c7cd51 Merge pull request #6071 from marcandre/observer_redef
Fix Observer by acting on singleton class. Fixes #3505.
2012-04-29 21:10:15 -07:00
Marc-Andre Lafortune
bad44e4f8f Fix Observer by acting on singleton class [#3505]
Also [issue #1034] [pull #6068]
2012-04-29 21:51:50 -04:00
Aaron Patterson
f975a8663e Merge pull request #5942 from bcardarella/confirmation_error_message_on_confirmation_attribute
confirmation validation error attribute
2012-04-29 16:29:33 -07:00
Marc-Andre Lafortune
569fb1fffb Generate appropriate error more judiciously 2012-04-29 00:51:56 -04:00
Marc-Andre Lafortune
85c056cc1f Fix error message:
- can pass the class, not the instance
- "instance method" is confusing, use "method :instance" instead
2012-04-28 23:20:42 -04:00
Carlos Antonio da Silva
f48d83b599 Refactor human attribute name 2012-04-28 12:14:59 -03:00
Carlos Antonio da Silva
cafe6a38f5 Do not modify options hash in human_attribute_name, remove reverse_merge 2012-04-28 11:23:29 -03:00
José Valim
fc6b115b88 Merge pull request #6025 from carlosantoniodasilva/amo-errors-refactor
Refactor AMo::Errors
2012-04-28 00:17:18 -07:00
Carlos Antonio da Silva
709b748f09 Refactor AMo::Errors
* Use merge!, remove reverse_merge
* Use case statement instead of is_a? checks
2012-04-27 21:04:13 -03:00
Carlos Antonio da Silva
9d1f6edbe0 Return earlier if attribute already changed in *_will_change! methods
Avoid obtaining the value and duplicating it when possible.
2012-04-27 20:44:09 -03:00
Vijay Dev
43af34c0f6 Merge branch 'master' of github.com:lifo/docrails 2012-04-28 00:56:17 +05:30
Mark Rushakof
8cc4159018 Use <tt>Foo::Bar</tt> instead of +Foo::Bar+
The latter doesn't render as code in HTML output.

Regex used in Rubymine to locate the latter form:

    (\+)(:*\w+:(?::|\w)+)(\+)
2012-04-27 00:00:30 -07:00
Oscar Del Ben
8c16333286 minor docs improvements 2012-04-26 10:34:51 +02:00
Oscar Del Ben
26353b993b Add documentation for validate options 2012-04-26 10:09:12 +02:00
Oscar Del Ben
b2ccae466e Enhance validations documentation 2012-04-26 09:35:26 +02:00
Vijay Dev
cd65682835 Merge pull request #5878 from oscardelben/refactor_observed_class
Refactor Observer.observed_class
2012-04-25 06:06:14 -07:00
Vijay Dev
4a3ce153f1 Merge branch 'master' of github.com:lifo/docrails 2012-04-25 18:33:36 +05:30
Oscar Del Ben
9072a08fac Refactor Observer.observed_class 2012-04-25 14:46:59 +02:00
Oscar Del Ben
f9f52435e7 fix code syntax 2012-04-25 12:14:08 +02:00
Oscar Del Ben
d089ee8639 Add include documentation to serialization 2012-04-25 12:00:19 +02:00
Oscar Del Ben
a631dd97cb Minor refactor of serializable hash 2012-04-25 11:46:47 +02:00
Oscar Del Ben
e34a4014ad improve serialization doc 2012-04-25 11:27:09 +02:00
José Valim
cd556c9388 Merge pull request #5841 from oscardelben/rename_count_observers
Rename Observing#count_observers to Observing#observers_count
2012-04-24 23:09:48 -07:00
José Valim
0cc32c5fd7 Merge pull request #5966 from oscardelben/fix_secure_password_setter
Fix secure_password setter
2012-04-24 10:50:44 -07:00
Oscar Del Ben
692b3b6b6a Fix secure_password setter 2012-04-24 19:16:01 +02:00
Oscar Del Ben
52188c77f1 Correct documentation of SecurePassword 2012-04-24 19:08:57 +02:00
Oscar Del Ben
ffa974d55c Refactor SecurePassword#authenticate 2012-04-24 19:03:59 +02:00
Brian Cardarella
4433b1a99a Support i18n attributes for confirmation 2012-04-24 01:05:41 -04:00
Brian Cardarella
fcc534ed76 confirmation validation error attribute
This will render the error message on :#{attribute}_confirmation instead
of on attribute itself. When rendering confirmation errors inline on the
form with form builders such as SimpleForm and Formtastic it is
confusing to the ender user to see the confirmation error message on the
attribute element. Instead it makes more sense to have this validation
error render on the confirmation field instead.

The i18n message has been updated for the confirmation validator error
message to include the original attribute name.
2012-04-23 17:16:05 -04:00
Oscar Del Ben
7536731a9a Improve observers documentation 2012-04-18 15:23:06 +02:00
Vijay Dev
5b336ff443 Merge branch 'master' of github.com:lifo/docrails 2012-04-18 00:10:06 +05:30
Thibaut Courouble
0c948a587d Fix confusing example in ActiveModel::Errors 2012-04-17 19:02:40 +03:00
Jan Xie
6e8a1bd0d3 fix ActiveModel::Validations::Callbacks doc 2012-04-15 20:42:58 +08:00
Michael de Silva
0631b26316 fix bad format [ci skip] 2012-04-14 11:58:43 +03:00
Oscar Del Ben
978221b99c Rename notify_observers argument *arg to *args to make it more clear
that the method accepts multiple arguments
2012-04-14 10:54:10 +02:00
Oscar Del Ben
27d6ccd8c8 Rename Observing#count_observers to Observing#observers_count 2012-04-14 10:48:53 +02:00
Oscar Del Ben
92a6cf0acd Improve example in initializer 2012-04-14 10:35:44 +03:00
Jon Leighton
e177525d6f Merge pull request #5736 from oscardelben/configuration_errors_reporting
Add better errors reporting for ActiveModel::Configuration
2012-04-11 16:20:42 -07:00
Oscar Del Ben
e6cfd76219 Add better errors reporting for ActiveModel::Configuration 2012-04-04 14:52:44 +02:00
Jurriaan Pruis
2d8396fc9f Updated/changed useless tr/gsubs 2012-04-03 15:16:09 +02:00
Grant Hutchins
ee235b3d3a Don't include deprecation in AM::Naming anymore 2012-03-31 21:37:24 -04:00
José Valim
e83e76eca4 Merge pull request #4904 from ask4prasath/refactor_dirty_module_with_helper
Changing active model dirty module helper method to more appropriate met...
2012-03-28 23:47:12 -07:00
Rafael Mendonça França
170956cdae Remove code duplication in InclusionValidator and ExclusionValidator.
Orginal code by @jamescook

Closes #1352

[Rafael Mendonça França + James Cook]
2012-03-28 18:57:56 -03:00
Piotr Sarnacki
c82fd8fc2a Allow ActiveModel::Name to duck type 2012-03-28 18:25:06 +02:00