Hash for ActiveRecord's select?

The source of the select method File activerecord/lib/active_record/relation/query_methods. Rb, line 34 def select(value = Proc. New) if block_given?

To_a. Select {|*block_args| value. Call(*block_args) } else relation = clone relation.

Select_values += Array. Wrap(value) relation end end suggests that it won't do what you're asking it to. However, as it can optionally take a block you might be able to coerce it into the behavior you're looking for Whenever I get confused about what I can and can't do with the Arel stuff, I just peruse the source at: Arel API I'm not sure this helps but at the very least it might send you in the right direction to explore.

The source of the select method-- # File activerecord/lib/active_record/relation/query_methods. Rb, line 34 def select(value = Proc. New) if block_given?

To_a. Select {|*block_args| value. Call(*block_args) } else relation = clone relation.

Select_values += Array. Wrap(value) relation end end -- suggests that it won't do what you're asking it to. However, as it can optionally take a block you might be able to coerce it into the behavior you're looking for... Whenever I get confused about what I can and can't do with the Arel stuff, I just peruse the source at: Arel API I'm not sure this helps but at the very least it might send you in the right direction to explore...

Snippet shows that the block for select was designed mostly for testing purposes: select with a block just fetches all the rows from respective table (via exhaustive SELECT * FROM table) into an array and applies Array#select to it, thus filtering it using Ruby language rather than SQL. – jdoe Jun 27 at 14:17 yeah, that sounds about right. – jaydel Jun 27 at 14:31.

Hash_of_fields = fields.last. Fields_in_hash = hash_of_fields. Field_or_fields : field_or_fields).

Field = "#{field.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions