Re: [Rails-core] ActiveSupport::HashWithIndifferentAccess integer

2015-09-21 Thread Al Tenhundfeld
I can't really speak to the usefulness of this, but I think you'll meet resistance due it being a breaking change. HashWithIndifferentAccess allows other types of keys; it just doesn't convert the key to string, as it does with symbols. Current behavior: hash = HashWithIndifferentAccess.new({"1"

Re: [Rails-core] Class list helper for HTML tags

2015-09-21 Thread Carlos Antonio da Silva
Hi Philippe, you should be able to use Rails' ability to pass in an array of classes, and Ruby's parentheses to create a scope, to handle this scenario for you: *<%= content_tag_for :tr, @model, class: ['foo', ('ready' if @model.ready?)] do %>* That should give you the same html response you exp

[Rails-core] Class list helper for HTML tags

2015-09-21 Thread Philippe Hässig
Hi Core List The usual way to conditionally add classes to html tags is in the following form: This is hard to read and nod very convenient. ReactJS has an Addon to use a Hash (Javascript Object) to conditionally add classes (https://github.com/JedWatson/classnames). Inspired by this I'

[Rails-core] postgres_fdw support?

2015-09-21 Thread Peter Dudek
Hello, does ActiveRecord have support for postgres_fdw? If not, are there plans to support foreign keys from tables within another database, provided the application can connect to both databases? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core

[Rails-core] ActiveSupport::HashWithIndifferentAccess integer

2015-09-21 Thread me
So I noticed that hash with indifferent access is not indifferent to integers as keys. Currently this doesn't work. hash = HashWithIndifferentAccess.new({"1" =>3}) hash[1] # => 3 The specific use case for me was passing around ids from the browser which was necessary because the form was using

Re: [Rails-core] Question about length of ActionDispatch::Routing::Mapper class file

2015-09-21 Thread George Mendoza
Thanks for sharing your thoughts on the Ctrl-P argument. I agree that code should be first, and that we should not bend code just to adapt to its supporting environment. I guess the bigger issues for long/short files are readability and maintainability. But that's for another discussion :) On Sat,