<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.ruby.rails.core">
    <title>gmane.comp.lang.ruby.rails.core</title>
    <link>http://blog.gmane.org/gmane.comp.lang.ruby.rails.core</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16749"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16744"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16735"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16730"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16726"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16720"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16719"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16718"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16717"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16715"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16702"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16700"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16671"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16670"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16668"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16665"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16659"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16655"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16653"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16645"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16749">
    <title>Typecast values on change_column for postgresql</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16749</link>
    <description>&lt;pre&gt;Hello,

Currently if you have a string column that have only number values (think a 
year column using string by mistake) and you want to change to integer, you 
can't.

If you apply this monkey-patch will be possible: 
https://gist.github.com/1393441


Note: if some value can't be casted by postgresql (if have a letter for 
example), the migration will fail as expected.

I think this is the expected behavior on change_column and I'm not sure but 
I guess mysql already does that.


What you think?

&lt;/pre&gt;</description>
    <dc:creator>Gabriel Sobrinho</dc:creator>
    <dc:date>2012-05-25T12:41:13</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16744">
    <title>How can I enable assets minifying in development environment?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16744</link>
    <description>&lt;pre&gt;I was trying an concept and found an weird issue when trying to enable 
compression in my development environment.

I'd like to be able to run my specs on the minified versions as well, 
so, using my rails_sandbox_jasmine gem, I'd like to use it this way:

SIMULATE_PRODUCTION=1 rake sandbox_assets:serve

And in my development.rb, I've set it to:

   config.assets.js_compressor = :uglifier
   config.assets.compress = !!ENV['SIMULATE_PRODUCTION']
   config.assets.digest = !!ENV['SIMULATE_PRODUCTION']
   config.assets.debug = !ENV['SIMULATE_PRODUCTION']

The debug (concatenation) and digest feature work but the generated 
assets are not minified.

Is that expected?

Thanks in advance,
Rodrigo.

&lt;/pre&gt;</description>
    <dc:creator>Rodrigo Rosenfeld Rosas</dc:creator>
    <dc:date>2012-05-24T16:30:02</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16735">
    <title>Engine's Application Controller</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16735</link>
    <description>&lt;pre&gt;Hi,

I've been using rails 3 engines and (at least in my experience) the engine's application controller is overidden by the app's application controller. Wouldn't it be better if the app would just load on top of the engine? 

I mean that if an engine's application controller has methods or anything else that does not collide with the stuff defined with the app, couldn't it be used?

Isn't this the default behaviour of ruby, that you can just reopen a class and add methods to it possibly overriding them but not deleting the rest of the class?


Regards,
Luís Ferreira



&lt;/pre&gt;</description>
    <dc:creator>Luís Ferreira</dc:creator>
    <dc:date>2012-05-23T18:46:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16730">
    <title>Simple idea for simplifying client-side code test built-in in Rails</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16730</link>
    <description>&lt;pre&gt;A while ago I started a topic here asking for including any framework 
for testing client-side code built into Rails and integrated to 
generators as well.

Rails 4 would be a great opportunity for including such a feature.

By that time, most (including me) have suggested Jasmine as such a 
framework. But actually I don't really care which framework would be 
chosen as it could be easily replaced.

For example, it is pretty clear for me that Konacha has set the proper 
way of dealing with such kind of tests:

https://github.com/jfirebaugh/konacha

Basically its approach is to provide two useful tasks:

konacha:serve - starts an isolated application sharing the asset 
pipeline for in-browser test runner;
konacha:run - suitable for CI, although I'm still not sure what approach 
to take for implementing such task, so this could be added in the 
future, after the other task, which approach is more obvious to opt for.

But it has a single issue that is too easy to be fixed - it is not 
framework agnostic:

https://github.com/jfirebaugh/konacha/issues/37

If Rails provided the idea used by Konacha built in, but providing hooks 
so that other gems could easily set up the template for their JavaScript 
runners, this would be a great solution to client-side integrated test 
solution.

Rails wouldn't even have to add support for common libraries, like 
Sinon.js or Jasmine. It could include any test runner.

For example, since Rails opts for test/unit assertions style as well as 
jQuery as default choices, it would make sense to keep with that style 
by choosing QUnit, which is also developed by the jQuey team and uses 
the assertions style:

https://github.com/jquery/qunit
http://docs.jquery.com/QUnit

I wouldn't use the default QUnit in the same way I don't use test/unit 
for my Ruby tests, but it should be trivial to just add a gem composed 
by one or two files that would enable me to use Jasmine while taking 
advantage of the assets pipeline.

Of course I can already have something like this working in current 
Rails, but the approach taken by Konacha seems so straightforward, clean 
and simple to me that it seems that every runner should take a similar 
approach basically changing only some settings like the template of the 
runner as well as the pattern where to look for test files.

It doesn't make sense for all similar gems to rewrite all the common 
infrastructure. And it would be great to transmit the idea that 
client-side code testing is as much important as server-side testing.

Actually chances are that client-side code will be more and more 
important as time passes. And still, Rails seems to be ignoring that by 
not providing tests for the CoffeeScript generated assets.

I wasn't sure about what approach to take at the time I first proposed 
including any JavaScript testing framework into Rails, but now I'm 
pretty convinced that Konacha's simple approach is the correct one to take.

We would just need to add some hooks to make it framework-agnostic, and 
that shouldn't be hard to do.

Any thoughts about this?

Kind regards,
Rodrigo.

&lt;/pre&gt;</description>
    <dc:creator>Rodrigo Rosenfeld Rosas</dc:creator>
    <dc:date>2012-05-23T03:05:19</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16726">
    <title>Having 2 ActiveRecord test failures on master: "Errors running test_postgresql" using pg 9.1</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16726</link>
    <description>&lt;pre&gt;Hi all,

I'm working on an ActiveRecord contribution, and I seem to be set up to run 
tests properly, but I have 2 failures occurring when I run `rake test` from 
within /activerecord. I am running PostgreSQL 9.1, so perhaps there is 
currently a problem running tests against that?

Has anyone else tried running these tests using PostgreSQL 9.1, and if so, 
do you see the same failures I'm seeing?

If this is a 9.1 problem, then I'll be happy to investigate it as part of 
the contribution I'm working on, but I would first want to make sure that 
really is the problem I'm seeing, and it's not caused by some other thing 
I've messed up with my configuration or process.

Here is the failure output...

  1) Failure:
test_eager_loading_with_conditions_on_join_model_preloads(EagerAssociationTest) 
[/Users/FileVault/stevej/Projects/rails/activerecord/test/cases/associations/
*eager_test.rb:1015*]:
*4 instead of 2 queries were executed*.
Queries:
SELECT "authors".* FROM "authors" INNER JOIN "posts" ON "posts"."author_id" 
= "authors"."id" INNER JOIN "comments" ON "comments"."post_id" = 
"posts"."id" WHERE (posts.title like 'Welcome%')
            SELECT COUNT(*)
            FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
            WHERE c.relkind in ('v','r')
            AND c.relname = $1
            AND n.nspname = ANY (current_schemas(false))

            SELECT a.attname, format_type(a.atttypid, a.atttypmod), 
d.adsrc, a.attnotnull, a.atttypid, a.atttypmod
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"author_addresses"'::regclass
               AND a.attnum &amp;gt; 0 AND NOT a.attisdropped
             ORDER BY a.attnum

SELECT "author_addresses".* FROM "author_addresses"  WHERE 
"author_addresses"."id" IN (1).
Expected: 2
  Actual: 4

  2) Failure:
test_custom_primary_key_on_new_record_should_fetch_with_query(HasManyAssociationsTest) 
[/Users/FileVault/stevej/Projects/rails/activerecord/test/cases/associations/
*has_many_associations_test.rb:1342*]:
*2 instead of 1 queries were executed*.
Queries:
            SELECT COUNT(*)
            FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
            WHERE c.relkind in ('v','r')
            AND c.relname = $1
            AND n.nspname = ANY (current_schemas(false))

SELECT COUNT(*) FROM "essays"  WHERE "essays"."writer_id" = $1 AND 
"essays"."writer_type" = $2.
Expected: 1
  Actual: 2

Thanks,

&lt;/pre&gt;</description>
    <dc:creator>Steve Jorgensen</dc:creator>
    <dc:date>2012-05-21T23:35:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16720">
    <title>Preferred method of dealing with options in final argument hash</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16720</link>
    <description>&lt;pre&gt;Hi guys,

I'm wondering what the preferred method of parsing the "options" hash is?

In one file, I've just seen these three different methods:

def foobar(options = {})
  options.reverse_merge!(:length =&amp;gt; 30)
  #...
  call_another_method(options[:length])
end

def foobar(options = {})
  options[:length] ||= 30
  #...  
  call_another_method(options[:length])
end

def foobar(options = {})
  length = options[:length] || 30
  #...
  call_another_method(length)
end

I'd like to go through and standardise them, at least in the files I'm 
working on. 

Which is the preferred method?

Thanks,
Jeremy

&lt;/pre&gt;</description>
    <dc:creator>iHiD</dc:creator>
    <dc:date>2012-05-17T17:40:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16719">
    <title>Update Rails on Rack documentation</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16719</link>
    <description>&lt;pre&gt;The Rails on Rack documentation is still using the 
"ActionController::Dispatcher" class but it no longer exists, I can update 
the documentation, I just wanted to discuss what's the best way to do it, 
I've tested with "run Rails.application" as well as with "run 
MyAppName::Application" (just like the generated config.ru file does it), 
what do you think?

So the documentation could end up like this:

Rails.application or MyAppName::Application is the primary Rack application 
object of a Rails application. Any Rack compliant web server should be 
using Rails.application or MyAppName::Application object to serve a Rails 
application.


There's another thing. Just after the text above you can find this:

rails server does the basic job of creating a Rack::Builder object and 
starting the webserver. This is Rails’ equivalent of Rack’s rackup script.


Which is not true, at least it doesn't do it directly, what it does is:

1. It creates a class: class Server &amp;lt; ::Rack::Server
2. The Server#start method calls "super"
3. Rack creates the Rack::Builder object

am I wrong?

So, what do you think about those changes?

Thanks in advance.

&lt;/pre&gt;</description>
    <dc:creator>Rafael Magaña</dc:creator>
    <dc:date>2012-05-17T08:23:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16718">
    <title>Original MySQL Adapter</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16718</link>
    <description>&lt;pre&gt;Just curious, is there a reason the original MySQL adapter gem is
still supported?  Or is it something that could be removed for Rails 4?

&lt;/pre&gt;</description>
    <dc:creator>Erich Menge</dc:creator>
    <dc:date>2012-05-17T12:38:52</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16717">
    <title>Rendering the partials and templates paths on top of them as HTML comments</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16717</link>
    <description>&lt;pre&gt;The idea is to make a little bit easier to find the rendered partials and 
templates when you start working in an existing project, I know we can see 
the log but I want something easier, in the log you don't know how the 
partial looks like only the name. Right now I'm doing this:

In 
https://github.com/rails/rails/blob/master/actionpack/lib/action_view/renderer/partial_renderer.rb#L308 I 
add this:

 content = layout.render(view, locals){ content } if layout
content.insert(0, "&amp;lt;!-- Partial Rendered: #{&amp;lt; at &amp;gt;path} --&amp;gt;\n") # &amp;lt;&amp;lt;&amp;lt;&amp;lt;

content


And I get this: 

http://d.pr/i/Og9X


but I'm looking for a better way to do it, and the main goal is to submit a 
patch if people think it's worth it or maybe a little gem, don't know, I'd 
like to have a config option in config/development.rb like this too:
      
          config.action_view.render_template_paths = true

Of course, this is only useful to me in development mode.

Any ideas?

&lt;/pre&gt;</description>
    <dc:creator>Rafael Magaña</dc:creator>
    <dc:date>2012-05-17T09:34:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16715">
    <title>Removing old API functionality from actionpack text helpers</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16715</link>
    <description>&lt;pre&gt;I was just reading through some of the actionpack text helpers and noticed 
that a lot of them have messages, such as:

# You can still use &amp;lt;tt&amp;gt;word_wrap&amp;lt;/tt&amp;gt; with the old API that accepts the
# +line_width+ as its optional second parameter:
#   word_wrap('Once upon a time', 8)     # =&amp;gt; Once upon\na time

As other methods (such as truncate) have now had this old API functionality 
removed, would this be a good time to set a depreciation warning on 
3-2-stable and remove the old functionality from master?

If so, I'm happy to do it.

Thanks,
Jeremy

&lt;/pre&gt;</description>
    <dc:creator>iHiD</dc:creator>
    <dc:date>2012-05-16T20:31:25</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16702">
    <title>ActiveSupport::TimeWithZone#to_time now returns utc?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16702</link>
    <description>&lt;pre&gt;Hello, just wanted to see if anyone else thinks this change from 3.1
is questionable?

https://github.com/rails/rails/commit/7872cc992bac76e976334d0c20649d69aad5652e#activesupport/lib/active_support/time_with_zone.rb-P5

For instance:

Time.zone = current_user.time_zone # set the TZ for the request
puts &amp;lt; at &amp;gt;some_object.created_at # returns created_at in user's TZ
puts &amp;lt; at &amp;gt;some_object.created_at.to_time # returns created_at in UTC

^ Calling to_time (as a precaution, in most instances) used to
preserve the timezone pre-3.1, but now it'll return UTC.

Another reason why this is strange is that Time.new.to_time preserves
the timezone, but TimeWithZone should act like Time.

&lt;/pre&gt;</description>
    <dc:creator>tiegz</dc:creator>
    <dc:date>2012-05-12T15:19:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16700">
    <title>What is the point of using :format in routes?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16700</link>
    <description>&lt;pre&gt;Today I had a strange behavior that made me suspect of jQuery at first, 
but then it happened that I've faced two gotchas, one from CoffeeScript 
and one from Rails itself.

I have something like this:

routes.rb
     post '/fields/:id.:format' =&amp;gt; 'fields#show', as: :field, 
constraints: {id: /\d+/}
     post '/fields/remove/:id' =&amp;gt; 'fields#remove', as: :remove_field

routes.js.coffee.erb:

&amp;lt;% h = Rails.application.routes.url_helpers
  { fields: false, remove_field: true }.each do |named_route, expect_id| %&amp;gt;
&amp;lt;% if expect_id %&amp;gt;
     window.&amp;lt;%= named_route %&amp;gt;_path = (id, format='.json')-&amp;gt; "&amp;lt;%= h.send 
:"#{named_route}_path", '999' %&amp;gt;#{format}".replace('999', id)
&amp;lt;% else %&amp;gt;
     window.&amp;lt;%= named_route %&amp;gt;_path = '&amp;lt;%= h.send :"#{named_route}_path" %&amp;gt;'
&amp;lt;% end %&amp;gt;
&amp;lt;% end %&amp;gt;

It happens that my remove action is implemented like this:

def remove
     Field[params[:id]].update deleted: true
     head :ok
end

and in my client code I had something like this:

$.post remove_field_path(id, ''), =&amp;gt; &amp;lt; at &amp;gt;refreshTree()

But as you have probably figured out the issue was that refreshTree was 
never called.

That is because CoffeeScript will compare (format == null) and it 
happens that ('' == null) in JavaScript:

https://github.com/jashkenas/coffee-script/issues/947

I've already fixed my routes.js.coffee.erb to something like:

path = (id, format)-&amp;gt; format = '.json' if format is undefined; ...

But then I realized that I was expecting Rails request to fail in the 
first place since my original route was:

post '/fields/remove/:id'

instead of

post '/fields/remove/:id(.:format)'

Then, reading the guide on Routing, I've realized that the (.:format) is 
not needed. I was confused because of the last example in the generated 
routes.rb to restore the Rails 1 routes style:

# match ':controller(/:action(/:id))(.:format)'

Shouldn't this comment be changed to the example below to avoid such 
confusion?

# match ':controller(/:action(/:id))'

Also, we could include some example like this to give a hint about the 
default (.:format) rule:

# post '/products/remove/:id', format: false, as: :remove_product


Does it make sense?

Sorry for the long e-mail but I thought that a bit of context on a real 
case might help understand how such examples in the routes.rb could help 
others.

Cheers,
Rodrigo.

&lt;/pre&gt;</description>
    <dc:creator>Rodrigo Rosenfeld Rosas</dc:creator>
    <dc:date>2012-05-11T17:58:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16671">
    <title>Mountable Engines and ApplicationControllers</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16671</link>
    <description>&lt;pre&gt;I've been messing around with mountable engines and I crossed a dilemma  that I am sure you faced when implementing them, what should ApplicationController inherit from?  Today each engine has a unique, name spaced ApplicationController, all of which inherit from ActionController::Base, then all of the controllers in each engine inherit from their corresponding ApplicationController.  I understand the need to set up the engines this way so that they can run outside of the main_app, but all of the controllers in Rails inherit from ApplicationController because they need to share code.  What primarily comes to mind are authentication methods and session variables, i.e. current_user.  So when creating a Rails app that uses mountable engines, it is nice for all of the things to access  a common ancestor.  One solution is to include modules in ActionController::Base, as it is a common ancestor to all the controllers in the app.  This process is outlined in this blog:

http://www.cowboycoded.com/2011/02/11/working-with-applicationcontroller-in-a-rails-3-engine/

While this works it has in my opinion two problems -- 
1) there is not a convention on where to put the module that gets included on ActionController::Base
2) because the module gets included on initialization, you have to restart your Rails app for any changes to take effect

What I have done to combat these issues is create an EnginesController that inherits from ActionController::Base, then have each of my engines' ApplicationControllers inherit from EnginesController.  This seems to solve the above issues as long as EnginesController is in the load path.

So my questions for the group are, does this seem like a reasonable solution or am I missing something like, this is why ActionController::Base exists and why don't you just open class it in the load path for the same effect?  And if this is a reasonable approach, is it worth considering a convention on where to put files that are shared among mountable engines and the main_app?

Thanks for your time and thoughts,


Scott

&lt;/pre&gt;</description>
    <dc:creator>Scott Johnson</dc:creator>
    <dc:date>2012-05-05T06:24:22</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16670">
    <title>Support the ability to write properties within models</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16670</link>
    <description>&lt;pre&gt;Why not support the ability to write properties within models?

After two years of trying I left mongoid to return to activerecord.
The reason why I came back to activerecord is that I realized I had
chosen MongoId just for the chance to express attributes in the model
itself and not for the advantages offered by mongodb.

I suppose this is a fairly common scenario, as well as the reason for
the adoption of other orms as DataMapper: I think that many of those
who choose these ORMs, often do so because they are attracted by the
possibility of writing the model classes in the classical way and not
because they consider truly worst ActiveRecord pattern.

It is not just a matter of style, what you can do with the approach
used by DataMapper or MongoId is something you can just not express
with ActiveRecord, an example over all, how could you do that in
ActiveRecord?

module Profile
  extend ActiveSupport::Concern
  included do
    field :name
    field :age, :as =&amp;gt; :integer

  end
end

class User &amp;lt; ActiveRecord::Base
  include Profile

end

class Player &amp;lt; ActiveRecord::Base
  include Profile

end
I wondered how we could achieve the same behavior with ActiveRecord
without altering its nature and in response I created this gem
ActiveRecordSchema (https://github.com/mcasimir/active_record_schema).

I have no interest in promoting my work I just want to propose that a
similar procedure can be adopted directly in Ruby on Rails

I do not know if a similar feature has already been taken into
account, in which case I'm sure you had good reasons for not adopting
it

---
mcasimir

&lt;/pre&gt;</description>
    <dc:creator>mcasimir</dc:creator>
    <dc:date>2012-05-08T10:51:06</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16668">
    <title>Sprockets, JST, Eco and escaping</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16668</link>
    <description>&lt;pre&gt;While it was a good move from Rails part to escape ERB &amp;lt;%= %&amp;gt; tags by 
default, it doesn't seem to happen to Sprockets as well.

The strange bit is that according to Sprockets documentation, it would 
be just a matter of naming your template as .jst.eco to enable Eco:

https://github.com/sstephenson/sprockets#javascript-templating-with-ejs-and-eco

Then, extracted from Eco documentation:

https://github.com/sstephenson/eco


&amp;lt;%= expression %&amp;gt;: Evaluate a CoffeeScript expression, *escape* its 
return value, and print it.

It means that by default it should escape "expression". So why isn't 
escaping happening by default on Rails JST eco templates?

I know about templating alternatives like Handlebars or Knockout, but I 
actually want to be able to use some ERB-like template.

For example, as far as I could find out Handlebars won't support local 
helpers for instance. I don't like the idea of polluting the global 
space with lots of helpers because it would be a mess for me to maintain 
such code.

Also, I miss an easy way to embed something like products_path in my ECO 
templates for obvious reasons, but this is a minor issue for me... 
Escaping is a very important one though.

Thanks in advance,
Rodrigo.

&lt;/pre&gt;</description>
    <dc:creator>Rodrigo Rosenfeld Rosas</dc:creator>
    <dc:date>2012-05-07T19:18:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16665">
    <title>Shouldn't the assets pipeline rewrite CSS paths?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16665</link>
    <description>&lt;pre&gt;There are some times where I add some JavaScript libraries as submodules 
to my project:

git submodule add git://... resources/project_name
cd assets/stylesheets/my_controller
ln -s ../../../resources/project_name/css/project_name.css
cd -
cd assets/images/my_controller
ln -s ../../../resources/project_name/img/sprite.png

While this works great in development mode, I have to create more 
symbolic links to make it work under production as well.

Here is why. Under development mode the css is written like this:

.some-class { background: url(sprite.png) } /* relative URL */

Under development this file path is 
"/assets/my_controller/project_name.css" while the image is located at 
"/assets/my_controller/sprite.png".

When assets:precompile is run, project_name.css no longer exists and the 
rule is appended to application.css, but the relative URL is not 
rewritten to 'my_controller/sprite.png' or 
'/assets/my_controller/sprite.png'.

The Grails Resources plugin supports URL rewriting for dealing with this 
kind of issue that happens when using an asset pipeline:

http://grails.org/plugin/resources
http://grails-plugins.github.com/grails-resources/ (sorry, documentation 
is not that good, but it works this way, I promiss)

It is not a good experience to have your application working under 
development and stopping working under production due to things like this.

Also, I like the idea of grouping my assets in sub-directories.

Shouldn't the Rails assets generator support URL rewriting in CSS for 
supporting such an organized tree both in development and production 
environment out of the box?

Am I missing something?

Best,
Rodrigo.

&lt;/pre&gt;</description>
    <dc:creator>Rodrigo Rosenfeld Rosas</dc:creator>
    <dc:date>2012-05-07T14:49:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16659">
    <title>Allow to use Proc on :order option of associations</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16659</link>
    <description>&lt;pre&gt;Take a look (not my production code but reproduces the desired behavior):

``` ruby
class Post &amp;lt; ActiveRecord::Base
  attr_accessible :published_at, :name

  has_and_belongs_to_many :categories, :order =&amp;gt; lambda { 
[Category.arel_table[:published_at].desc, Category.arel_table[:name]] }
end
```

``` ruby
class Category &amp;lt; ActiveRecord::Base
  attr_accessible :published_at, :name

  has_and_belongs_to_many :posts, :order =&amp;gt; lambda { 
[Post.arel_table[:published_at].desc, Post.arel_table[:name]] }
end
```

``` ruby
Category.first.posts
# =&amp;gt; TypeError: Cannot visit Proc
```

``` ruby
Post.first.categories
# =&amp;gt; TypeError: Cannot visit Proc
```

The problem happens when we have a cross reference between two models and 
need to use arel due to difference on quote of columns.

Sounds reasonable?

Reference: https://github.com/rails/rails/issues/6146

&lt;/pre&gt;</description>
    <dc:creator>Gabriel Sobrinho</dc:creator>
    <dc:date>2012-05-03T18:28:14</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16655">
    <title>Loading delegates in Rails View Helpers on to instance objects</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16655</link>
    <description>&lt;pre&gt;Not sure if this should be done, but I'm writing some excel reports in 
ruby.  In the rxls views, i'm finding that i refer to &amp;lt; at &amp;gt;report all the time. 
 

In order to make my life easier i created a bunch of methods in the 
ReportsHelper for the base ReportsController.  But i'm finding that i'm 
essentially defining delegates that point straight to my &amp;lt; at &amp;gt;report object. 
 It makes my reports views more readable.

I wanted to find some way to load at least some of these methods as 
delegates.  I was thinking about using self.included on the ReportsHelper 
module and loading them onto the class there.  

I'm trying to look through ActionPack to see where these are loaded, but no 
dice.  I'm worried about any magic that might be going on.  Also, I'm just 
curious as to how and when these are loaded.  Any good places to start?

&lt;/pre&gt;</description>
    <dc:creator>dcunited001</dc:creator>
    <dc:date>2012-05-03T05:31:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16653">
    <title>Updating rails 2.3 plugins database</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16653</link>
    <description>&lt;pre&gt;As I discovered on github https://github.com/rails/rails/issues/5424
rails engines migrations should be checked into source control.
But I don't see how it's possible to upgrade database with rails 2.3 
plugins migrations to rails 3 engines migrations. (duplicate table and 
column names, etc.)
Do you have any thoughts?

&lt;/pre&gt;</description>
    <dc:creator>Vanuan</dc:creator>
    <dc:date>2012-05-02T18:18:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16645">
    <title>Set a tag of a collection rendering</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16645</link>
    <description>&lt;pre&gt;Could useful set the tag of  a collection when you render it, like
backboneJS?

for example , given a partial:
```erb
&amp;lt;span&amp;gt;&amp;lt;%=post.autor%&amp;gt;&amp;lt;/span&amp;gt;
&amp;lt;span&amp;gt;&amp;lt;%=post.created_at%&amp;gt;&amp;lt;/span&amp;gt;
```
you could render inside two different tags

```erb
&amp;lt;ul&amp;gt;
&amp;lt;%= render &amp;lt; at &amp;gt;posts,:tag=&amp;gt;'li'%&amp;gt;
&amp;lt;/ul&amp;gt;
```
output:

```html
&amp;lt;ul&amp;gt;
&amp;lt;li&amp;gt;
 &amp;lt;span&amp;gt;one&amp;lt;/span&amp;gt;
 &amp;lt;span&amp;gt;Tomorrow&amp;lt;/span&amp;gt;
 &amp;lt;/li&amp;gt;

&amp;lt;li&amp;gt;
 &amp;lt;span&amp;gt;two&amp;lt;/span&amp;gt;
 &amp;lt;span&amp;gt;Today&amp;lt;/span&amp;gt;
 &amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
```
or

```erb
&amp;lt;div&amp;gt;
&amp;lt;%= render &amp;lt; at &amp;gt;posts,:tag=&amp;gt;'div'%&amp;gt;
&amp;lt;/div&amp;gt;
```
output:

```html
&amp;lt;div&amp;gt;
&amp;lt;div&amp;gt;
 &amp;lt;span&amp;gt;one&amp;lt;/span&amp;gt;
 &amp;lt;span&amp;gt;Tomorrow&amp;lt;/span&amp;gt;
 &amp;lt;/div&amp;gt;

&amp;lt;div&amp;gt;
 &amp;lt;span&amp;gt;two&amp;lt;/span&amp;gt;
 &amp;lt;span&amp;gt;Today&amp;lt;/span&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

```
or without any tag

&lt;/pre&gt;</description>
    <dc:creator>angelo capilleri</dc:creator>
    <dc:date>2012-04-29T15:25:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16644">
    <title>new queueing API</title>
    <link>http://comments.gmane.org/gmane.comp.lang.ruby.rails.core/16644</link>
    <description>&lt;pre&gt;Hi guys, I wanted to discuss the new Queueing API for those of us who
are implementing an out-of-process version.  In my case, I write
Sidekiq [1] and would like to support the new API once Rails 4 is
released.  My issue is that because the API is object-oriented rather
than message-oriented, implementation of out-of-process workers is
difficult.

The API is Queue#push(job) where job has a run method.  Ruby doesn't
have a great solution for serializing a Ruby object across the wire.
Marshal limits the API to Ruby solutions (which rules out RabbitMQ, et
al), JSON can't fully serialize Ruby objects (e.g. symbols) and YAML
has a number of issues in practice that make it painful to use (e.g.
see the monkeypatches DelayedJob has to use [2]).

So I love the simplicity of the API but think it will lead to painful
implementation issues.  What do you think about defining a simpler
message format that can be fully serialized and deserialized via JSON
/ YAML / etc instead of using a Ruby object?

mike

[1] http://mperham.github.com/sidekiq/
[2] https://github.com/collectiveidea/delayed_job/blob/master/lib/delayed/psych_ext.rb

&lt;/pre&gt;</description>
    <dc:creator>Mike Perham</dc:creator>
    <dc:date>2012-04-29T02:31:27</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.ruby.rails.core">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.ruby.rails.core</link>
  </textinput>
</rdf:RDF>

