| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
kuroda/translation_of_deeply_nested_model_attributes
Fix human attribute_name to handle deeply nested attributes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a model nests another model that also nests yet another model
using accepts_nested_attributes_for method, its Errors object can
have an attribute name with "contacts.addresses.street" style.
In this case, the dots within the namespace should be substituted
with slashes so that we can provide the translation under the
"activemodel.attributes.person/contacts/addresses.street" key.
This commit is related to #3859.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Passing a falsey option value for a validator currently causes that validator to
be enabled, just like "true":
ActiveModel.validates :foo, :presence => false
This is rather counterintuitive, and makes it inconvenient to wrap `validates` in
methods which may conditionally enable different validators.
As an example, one is currently forced to write:
def has_slug(source_field, options={:unique => true})
slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? }
before_validation slugger
validations = { :presence => true, :slug => true }
if options[:unique]
validations[:uniqueness] = true
end
validates :slug, validations
end
because the following reasonable-looking alternative fails to work as expected:
def has_slug(source_field, options={:unique => true})
slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? }
before_validation slugger
validates :slug, :presence => true, :slug => true, :uniqueness => options[:unique]
end
(This commit includes a test, and all activemodel and activerecord tests pass as before.)
|
|\ \ |
|
| | | |
|
|\ \ \
| |/ /
|/| |
| | |
| | | |
ayamomiji/add-self-to-allow-method-name-using-ruby-keyword
add `self.` to allow method name using ruby keyword
|
| | |
| | |
| | |
| | | |
column that named as a ruby keyword
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
XmlMini define the xml 'datatime', but according to
http://www.w3.org/TR/xmlschema-2/#dateTime could be better
change this to 'dateTime' with upper case letter 'T.
So 'DateTime' and 'Time' are redefined from 'datetime' to 'dateTime'
add the changing to the changelog
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit cae1ca7d1be9c79c7ef012a1f62aef9d3bb815f8, reversing
changes made to da97cf016a8ffd1f54f804cd881f393e5d6efc18.
These changes break the build, it needs more investigation.
|
|\ \ \
| | | |
| | | | |
Call undefine_attribute_methods only when defining new attributes
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | | |
Remove sort on attributes.keys
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix has secure password
|
| | | | |
| | | | |
| | | | |
| | | | | |
options to turn validations off.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
activerecord/lib/active_record/core.rb
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| |_|_|_|/
|/| | | | |
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
clean the erros if an object that includes validation is duped.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Fixes #5953
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
actionpack/lib/action_view/helpers/asset_tag_helper.rb
|
| |/ / / / |
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Use the more idiomatic tap method
|
| | | | | |
|
| |/ / /
|/| | |
| | | |
| | | | |
collection-thing.
|
| | | | |
|
| |_|/
|/| | |
|
|\ \ \ |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Allow extra arguments for Observers
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix Observer by acting on singleton class. Fixes #3505.
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
Also [issue #1034] [pull #6068]
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
bcardarella/confirmation_error_message_on_confirmation_attribute
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.
|
| | | | | | |
|
| |/ / / /
|/| | | |
| | | | |
| | | | |
| | | | | |
- can pass the class, not the instance
- "instance method" is confusing, use "method :instance" instead
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Refactor AMo::Errors
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | | |
* Use merge!, remove reverse_merge
* Use case statement instead of is_a? checks
|
|/ / / /
| | | |
| | | |
| | | | |
Avoid obtaining the value and duplicating it when possible.
|