Roman
2012-Nov-15 12:19 UTC
Suggestion: use `select` values if `pluck` called with no args
I suggest that if you don''t pass any args to ActiveRecord#pluck, it would use the select values. This follows along well with the way other AR::Calculations work. As an extra benefit we would be able to pluck virtual columns. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/Tlb8yXzd4tsJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Rafael Mendonça França
2012-Nov-19 02:10 UTC
Re: Suggestion: use `select` values if `pluck` called with no args
What happens if you call pluck without any select value? I think this is a good addition to the Rails code base. Mind to open a pull request? Rafael Mendonça França http://twitter.com/rafaelfranca https://github.com/rafaelfranca On Thu, Nov 15, 2012 at 10:19 AM, Roman <broilerster@gmail.com> wrote:> I suggest that if you don''t pass any args to ActiveRecord#pluck, it would > use the select values. This follows along well with the way other > AR::Calculations work. As an extra benefit we would be able to pluck > virtual columns. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/Tlb8yXzd4tsJ. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- 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 rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Roman
2012-Dec-16 13:54 UTC
Re: Suggestion: use `select` values if `pluck` called with no args
Hi Rafael, somehow I didn''t get a notification about your answer and thought nobody replied. Will need to think about this more. On Monday, November 19, 2012 4:11:47 AM UTC+2, Rafael Mendonça França wrote:> > What happens if you call pluck without any select value? > > I think this is a good addition to the Rails code base. Mind to open a > pull request? > > Rafael Mendonça França > http://twitter.com/rafaelfranca > https://github.com/rafaelfranca > > > > On Thu, Nov 15, 2012 at 10:19 AM, Roman <broil...@gmail.com <javascript:>>wrote: > >> I suggest that if you don''t pass any args to ActiveRecord#pluck, it would >> use the select values. This follows along well with the way other >> AR::Calculations work. As an extra benefit we would be able to pluck >> virtual columns. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Core" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-core/-/Tlb8yXzd4tsJ. >> To post to this group, send email to rubyonra...@googlegroups.com<javascript:> >> . >> To unsubscribe from this group, send email to >> rubyonrails-co...@googlegroups.com <javascript:>. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-core?hl=en. >> > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/VU1niBOWi7wJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Maybe Matching Threads
- Suggestion: `before_save on: :create` should either work or raise an exception
- #asset_url helper method
- validates :boolean_field, presence: true misconceptions
- Re: Digest for rubyonrails-core@googlegroups.com - 4 Messages in 3 Topics
- attr_accessible on some properties + attr_protected on others makes class 'open-by-default'