[Rails-core] Testing process inquiry (Research study)

2016-02-29 Thread Matías Waterloo
 

Hello,

 

I am a research assistant at the University of Nebraska-Lincoln. I am 
working on continuous integration environments. My current project involves 
Rails and Travis.

I looked at the Rakefiles, .travis.yml and ci/travis.rb files and I noticed 
that some tests are run twice in a single build: once all together in a 
single process and then in isolation. For instance, action pack in this 
build . I would like to 
understand why you are doing this. I suspect you want to catch test 
dependency issues.  I would appreciate it if you could confirm my thoughts 
or give me any detail about this process.

 

 

Thank you,

Matias Waterloo

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] Enhancement: improved ActiveModal::Errors enumeration

2016-02-29 Thread Rafael Mendonça França
I'm positive for this enhancement. The type information is already retained
in Rails 5 but having real object could be real handy.

On Mon, Feb 29, 2016 at 12:47 PM Evan Prothro 
wrote:

> I love the concept and usability of an ActiveModel::Errors paradigm.
> However, I and others often find it frustrating to work with the
> implementation.
>
>
> I'd love to see a proper ActiveModel::Error object, where the errors
> attribute of a model including ActiveModel::Errors was an Enumerator of
> these objects.
>
>
> There are various implied benefits and added flexibility that could be
> introduced in a backwards compatible way later, and immedate benefits.
> Would love to know what y'all think about this. Happy to implement if
> desired.
>
>
> Immediate
> Benefits
>
>
> The
> error type could be retained
>
> APIs we build prefer to return Error objects to clients with the
> following schema:
>
> {
>   attribute:  "The model attribute to which the error applies. If blank, the 
> error applies generically to the base model.",
>   type:   "The type of error encountered with the model attribute or 
> model."
>   messsage:   "An internationalized message that can be displayed to a user.",
> }
>
> In particular, the type attribute allows clients to couple any logic they
> need on the error attribute and type, not themessage, which should be
> able to change with business/product needs.
>
> With a proper ActiveModel::Error object, this is easily done. With the
> current enumerable design, this is not a clean extension to make
> .
>
>
> The
> error message can be lazily looked up
>
> Currently, the message interpolation is looked up when the error is added
> to the model. This isn't necessarry, and is easily lazily evaluated when a
> derived attribute on an Error object.
>
>
>
> Other
> Enhancements easily enabled
>
>
> Accessing
> the attribute value more cleanly
>
> error = model.errors.first
> error.attribute
> => :username
> error.attribute_value
> => 'eprothro'
>
>
>
> Easier
> custom interpolation parameters
>
> # en.yml
> errors:
>   models:
> user:
>   attributes:
> username:
>   taken: "%{value} has already been taken."
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at https://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


[Rails-core] Enhancement: improved ActiveModal::Errors enumeration

2016-02-29 Thread Evan Prothro


I love the concept and usability of an ActiveModel::Errors paradigm. 
However, I and others often find it frustrating to work with the 
implementation.


I'd love to see a proper ActiveModel::Error object, where the errors 
attribute of a model including ActiveModel::Errors was an Enumerator of 
these objects.


There are various implied benefits and added flexibility that could be 
introduced in a backwards compatible way later, and immedate benefits. 
Would love to know what y'all think about this. Happy to implement if 
desired.


Immediate
 
Benefits

The
 
error type could be retained

APIs we build prefer to return Error objects to clients with the following 
schema:

{
  attribute:  "The model attribute to which the error applies. If blank, the 
error applies generically to the base model.",
  type:   "The type of error encountered with the model attribute or model."
  messsage:   "An internationalized message that can be displayed to a user.",
}

In particular, the type attribute allows clients to couple any logic they 
need on the error attribute and type, not themessage, which should be able 
to change with business/product needs.

With a proper ActiveModel::Error object, this is easily done. With the 
current enumerable design, this is not a clean extension to make 
.

The
 
error message can be lazily looked up

Currently, the message interpolation is looked up when the error is added 
to the model. This isn't necessarry, and is easily lazily evaluated when a 
derived attribute on an Error object.


Other
 
Enhancements easily enabled

Accessing
 
the attribute value more cleanly

error = model.errors.first
error.attribute
=> :username
error.attribute_value
=> 'eprothro'


Easier
 
custom interpolation parameters

# en.yml
errors:
  models:
user:
  attributes:
username:
  taken: "%{value} has already been taken."

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.