Hi everyone,
I am happy to announce that Rails 5.0.7 and 5.1.6 have been released.
## CHANGES since 5.0.6
To view the changes for each gem, please read the changelogs on GitHub:
* [Action Cable CHANGELOG](
https://github.com/rails/rails/blob/v5.0.7/actioncable/CHANGELOG.md)
* [Action Mailer CH
> Renaming it to: .prevent_html_escaping would make it unambiguous, and
> directly refer to what is actually being done (so that the programmer doesn't
> have to infer what "safe" means, precisely).
Yes, we should rename it to something even longer so that people don
hat patch made
> find_sti_class part of the public interface, would that be likely to be
> accepted?
>
If it could be written so that there's a single method to overwrite to
provide a custom mapping from column value to class and it had no impact on
performance then it should stand a pretty
On 2 Dec 2013, at 03:42, Egor Homakov wrote:
> What I actually want is to make people understand and check if they have this
> problem. Deprecation is on of the means to do it.
No, it isn't. Deprecation means we intend to remove that feature in the next
major release, which we don't want to d
s Grayson's
concern as it's only for accepting an array of valid values for things like
host, subdomain, port etc.
Andrew White
https://twitter.com/pixeltrix
https://github.com/pixeltrix
--
You received this message because you are subscribed to the Google Groups "Ruby
on
gexp.new(Photo::TYPES.join("|")) }
>
> If you think this can be accepted into Rails I will start to work on it.
>
This is already in Rails 4 - it was added in this commit:
https://github.com/rails/rails/commit/90d2802b71a6e89aedfe40564a37bd35f777e541
Andrew White
https://t
If you only want to run a validation on an attribute if it is valid at that
point in the validation process then here's a trick:
module AttributeValidation
extend ActiveSupport::Concern
included do
attribute_method_suffix '_valid?', '_invalid?'
end
private
def attribute_valid?(at
m_for/singleton resource issue (#1769).
Andrew White
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrail
Rails 3 was slow and it was preventing them from
upgrading. We addressed that concern by developing a new version that focussed
on what it was being used for and not some theoretical use.
Andrew White
--
You received this message because you are subscribed to the Google Groups "Ruby
t caching headers though.
> I'm really sorry if I'm bothering you with all those requests. This really
> isn't my intention and I do value a lot all your feedback.
No, this is the correct place to discuss these things rather than polluting the
issues tracker.
Andrew White
--
index
render :json => params
end
def expire
expire_action :action => :index
expire_action :action => :index, :format => :json
head :ok
end
def set_content_type
self.content_type = Mime::JSON
end
end
This serves cached /test/index and /test/index.json as a
in the response for both URLs.
You can do that now using an empty option in your regexp:
get '/products' => 'products#index', :format => /|json/
This will match /products and /products.json
Andrew White
--
You received this message because you are subscribed to the Google Gr
t shortcoming could be minimized if we assumed the "format: :json" to
> restrict the only possible format to 'json' instead of using it as a default.
>
> Please consider this change to routing DSL for Rails 4.
We could certainly consider whether :format => :
formatted urls - these routes work fine:
constraints :format => 'json' do
get 'test/index', :as => :index
get 'test/expire', :as => :expire
end
You'll need to pass the format to the expire_action as it doesn't infer it from
the curre
ucts#list', :format => false, :defaults => {
:format => 'json' }
The only way to turn off the :format segment being added is to either insert it
yourself or pass :format => false.
> Maybe I'm the only one considering the current behavior an issue, but I
On 13 Jul 2011, at 08:20, Corin Langosch wrote:
> What about making the polymorphic routing in rails to try a plural route
> first. If it fails, try a singleton route. If it fails, raise.
>
> This is not the nicest and most performant way (the result could be cached in
> production so it doesn
ails 3 - it has been :nodoc: for years. What's been deprecated is accessing
the routes by using the constant ActionController::Routing::Routes which was
aliased to ActionController::Routing::RouteSet.
Andrew White
--
You received this message because you are subscribed to the Google Groups
On 17 Jun 2011, at 14:44, Lee Irving(MagpieUK) wrote:
> I have an object that accepts nested attributes for a child object,
> both objects have :attr_accessible setup with the same roles defined.
>
> When I pass in the attributes for the child object I was hoping that
> it would trigger the attr
On 25 May 2011, at 18:26, dblock wrote:
> I have two controllers, SomeController and Admin::SomeController. When
> SomeController is loaded first (which happens under spork, found out
> by editing ActiveSupport::AbstractController) I get warning: toplevel
> constant SomeController referenced by A
On 26 Oct 2010, at 09:48, Xavier Noria wrote:
> I've seen this confusion several times. Let me explain.
Yes, you're right - I was under the impression that it was turned off in
production since require and autoload are inherently unsafe in threaded
applications.
--
You received this message b
On 23 Oct 2010, at 15:45, Kandada Boggu wrote:
> It is a typo, I am using autoload_paths.
Does it work if you add your path to eager_load_paths as well as
autoload_paths? e.g:
config.eager_load_paths << File.join(RAILS_ROOT, "custom_lib", "models")
It looks as though extra autoload_paths do
On 30 Aug 2010, at 20:38, Martin S. wrote:
> In my eyes this doesn't make sense. Is there a way to get the
> id_constraint of the parent_resource?
Martin, yes it appears there's a bug here. Can you please create a ticket.
As a workaround if you spec the routes in full it works as expected:
re
On 29 Aug 2010, at 03:34, Jose wrote:
> This last evaluation is wrong, and breaks equality checks and
> expressions such as @conversation.users.include?(some_user)
>
> If I disable class caching, the problem disappears (but that's not
> ideal for development). Maybe I'm doing something that brea
On 4 Aug 2010, at 14:15, Ned wrote:
> If anyone has an idea, or a thought of why this change was made, would
> be good to hear
It was done as part of some changes to add back support for custom new actions
e.g. /posts/new/preview. To support this we added new scope to resources to
match member
On 27 Jul 2010, at 23:07, Ryan Bigg wrote:
> You could make it a non-route separator, such as 1-ryan-bigg. The AR finders
> can take this:
Just to correct the misconception about Rails 3. Rack::Mount doesn't force / to
be a route separator - it uses statistical analysis to determine the optima
u're after.
Why not just override the :id regexp:
resources :users, :id => /[0-9]+\/[-_a-zA-Z0-9]+/
This would match '/users/123/andrew-white/edit' to users#edit
Andrew
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core&q
:Account has_many :users needs to be able to pull Admin::User,
> ActiveRecord should know how to do that.
Okay, I've patched compute_type so that the error doesn't get triggered:
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2283
Andrew White
--
You receive
On 15 Feb 2010, at 14:26, Yehuda Katz wrote:
> Actually that's precisely where it belongs. ActiveSupport::Dependencies
> should mirror the Ruby logic exactly (in other words, it should be possible
> to require all the files manually and have everything work). If
> Admin::Account has_many :user
nd
You'll always have to specify the class on the association:
class Admin::Account < ActiveRecord::Base
has_many :users, :class_name => "Admin::User"
end
My aesthetic sense rejects this as a solution :-)
The alternative is to implement a custom constant lookup system wit
constant Baz!
>> "Foo::Bar".const_get("Baz")
ArgumentError: Foo is not missing constant Baz!
If we check for the presence of the constant before calling
load_missing_constant then we prevent these errors. Okay it may be not the
cleanest or the correct solution but the alte
ismatch between load_missing_constant and Ruby's constant
resolution. Personally I'd consider this a bug in Ruby - I don't see any valid
reason for the two different scopes.
Andrew White
--
You received this message because you are subscribed to the Google Groups "Ruby
on Ra
oo"], but your recent changes make that
assumption so I don't think the resolution is valid. Also the fact that the
raise can be triggered by errors elsewhere leading to hours of fruitless
debugging needs to be addressed in some way I feel.
Andrew White
--
You received t
isolate this
but since the Gemfile is going to be under version control this essentially
forces the same preference on everyone working on a project.
Is this the intention or should I create a Lighthouse ticket?
Andrew White
--
You received this message because you are subscribed to the
On 29 Dec 2009, at 12:40, Allen Madsen wrote:
> I think the problem is that there is no way to distinguish between a nil
> value and a blank value coming from the request. They both look the same and
> they both have their uses. I don't think your solution solves this problem,
> because there a
On 28 Dec 2009, at 18:04, Josh Susser wrote:
> That's reasonably concise, but just keep in mind that all of this is
> just to make Ruby act more like Perl where empty strings are false-ish
> values. I'm sure there are other use cases for #presence, but empty
> strings that come from form su
On 1 Nov 2009, at 09:09, Gaspard Bucher wrote:
> I do not fully understand why we do not protect against case (b) by
> escaping the data *prior to its entry in the database*, eventually
> writing audit migrations when we discover new vulnerabilities. I see
> two main advantages of the *pre-datab
ll be prefixed
with that model's table name so you wouldn't want to just strip it
out. The question is do we want to start loading models in the
generator to see if it's a AR class or a generic model or do we assume
a module and then leave it to the developer to fix
what's
>> going
>> to be the public API separate from the current test suite which is
>> tightly coupled to the current codebase. We could also do with a test
>> application for integration testing.
>
> That would be great, but that would also be supplemental to
ture so I'm willing to cut them so slack at the
moment.
What we could do with is a decent set of specs that cover what's going
to be the public API separate from the current test suite which is
tightly coupled to the current codebase. We could also do with a test
application f
t for
specifying an array scope to make it easier to work with polymorphic
associations. This seems like something that should be in the official
repository - is it worth creating a ticket?
Andrew White
--~--~-~--~~~---~--~~
You received this message because yo
I've come up with a patch to reinstate production mode reloading of
templates:
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1909
I'd appreciate it if people could run it against some complex apps as
I'm sure I've missed somet
Currently, construct_finder_sql gives precedence to :select defined
within the current scope over any passed in option. Unfortunately this
breaks what I thought was a nice clean solution to finding what tags
were applied to a model within a scope, e.g:
module Taggable
def self.included(
On 22 Oct 2007, at 03:18, James Moore wrote:
> This is two models. What happens when you split this out into one
> model per .rb file?
It was in two files - I just combined it in the email for clarity.
Andrew White
--~--~-~--~~~---~--~~
You receive
ows it to
work and all it then passes all the tests.
Shall I submit a patch with this fix or is it likely to be rejected?
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core
encies code to handle
namespaced models more cleanly or should I just try and fix it in AR?
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group
so
that developers can add a prefix before all the routes in a namespace
if so desired.
Also I was wondering whether map.namespace should apply to ordinary
routes (named or otherwise) as well as resource routes.
Andrew White
--~--~-~--~~~---~--~~
You receive
se as looking at the svn history it appears there
was at some point in the distant past.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group,
prefixed named route helpers?
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe fr
licate routes - defaulting to /
means that out of the box 1.2.4 and above will recognize both 1.2.3
and 2.0 urls.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
ork in 2.0.
It passes all the tests and I've checked it against my own sites and
everything appears to check out but I'd appreciate some feedback if
it breaks anyone's existing sites (or some +1s if it doesn't!)
Thanks,
ANdrew White
[1] http://dev.rubyonra
ould write up some test cases which currently fail, then we
> can figure out where to go from here.
I went a bit further a came up with a set of tests that show all the
issues with nested models that I can find. I've attached them to th
changes
I'm sure there's some situation which wouldn't work but at least it
help reduce the need to manually specify config.plugins.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
On 19 Sep 2007, at 14:24, Michael Koziarski wrote:
> I'm not really sure why you want it to find ProductItem in addition to
> Item? Couldnt you just use has_many :product_items?
You can but you end up with accessing stuff like
@products.product_items which is a bit redundant. If you name the
but I guess that's a matter of personal
preference.
Anyway consider the matter closed! :-)
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this gr
?
Also AFAICS the association reflection caches this result so
performance impact should negligible - is this assumption correct?
Any other comments would be appreciated too.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed
in the ancestor chain I'll amend the patch.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroup
mostly works it just needs someone to spend a
couple of days going through and addressing all these small issues.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group
the patch and no action
defined you'll get a not found exception in every case. With the
patch applied you'll at least get at method not allowed for update
and delete.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are
;t have
collection actions? I noticed in edge and stable that
map_collection_actions is called in map_singleton_resource. It
doesn't choke if you pass :collection to map.resource but they end up
with the same names as member actions.
Andrew White
--~--~-~--~~~
his?
I have no problem, but I personally feel that Rails should be able to
generate valid markup out of the box. Anyway I've closed the ticket
with a link to the available plugin.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you a
ls.
To me that would make Rails dogmatic rather than just opinionated
software. If I can generate images with Rails why would should it
only allow me to product invalid HTML (as that's what XHTML served as
text/html is).
Andrew White
--~--~-~--~~~---~--~---
share that feeling.
HTML4 is perfectly fine - I don't recall the W3C revoking it at any
point. I'm assuming that you serve your pages as text/html in which
case all you are doing is producing invalid HTML as that's how the
browser will treat it.[1]
Andrew White
[1] http://l
t type such as application/xhtml+xml?
Want me to close it then?
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to rubyonrails
nts:
http://webkit.org/blog/?p=68
http://www.hixie.ch/advocacy/xhtml
I know that the above comments have been rebutted by various people,
but since some people are in one camp or the other I think it makes
sense provide the option with the default setting being current
behaviour of course
atching that faster after this patch?
Probably not, but it's not slower. :-)
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email
:action => 'show'
end
map.with_options :controller => 'shop/thumbnails', :conditions =>
{ :method => :get } do |thumbnails|
thumbnails.shop_product_image_thumbnail 'shop/products/:product_id/
images/:image_id/:id.:format', :action => 'show
dn't be there.
If you don't think it should be applied on security grounds what
about efficiency? If your site consists of mainly read-only resources
then you'll have 3-4 times as many routes as you really need.
Andrew White
--~--~-~--~~~---~--~--
7;d like
some feedback on whether this goes against the principles of RESTful
routing or is it functionality people would like to see included.
http://dev.rubyonrails.org/ticket/9460
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are su
On 28 Aug 2007, at 22:56, Tobias Luetke wrote:
> Sounds great, please do attach the patch to http://
> dev.rubyonrails.org/ticket/8558
> and i'll get it in if you think its ready.
> Thanks a lot for looking into this.
Patches for stable and edge with tests have been uploade
or deprecated functionality that I can look at to get an idea of how
to do them?
When I've done that should I create a new ticket or upload the patch
to the existing ticket 8558?
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subsc
d then upgrade to 2.0 and rewrite their routes using
namespaces.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to rubyonrails-cor
On 28 Aug 2007, at 06:02, Michael Koziarski wrote:
>> 2. Should nested resources routes be named as in edge with the old
>> names being deprecated?
>
> Yes
One other thing - should the deprecated old names remain in edge/2.0
or should they be removed?
Andre
tes place the
format parameter at the end of the url like they are in edge? The old
named routes could maintain the existing placement for backwards
compatibility.
Andrew White
PixeltrixT: 024 7625 6244
12 Turbine Hall M: 07973 190 907
Electric Wharf
his is not desired.
Thanks for the clarification.
I'm guessing that the namespace option should be applied to nested
resources - edge currently only applies it to associations. I've
created a ticket (9399) with a patch to fix this.
Andrew White
--~--~-~--~~~--
ich changes the behavior to this, but if it's 'Not
The Right Way' please can someone enlighten me
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" gro
be included?
I'd be more than willing to write up an acceptable patch to stable if
required.
Andrew White
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to thi
76 matches
Mail list logo