Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

How is the Arel#extract method used in rails? #110

gy opened this Issue Mar 14, 2012 · 3 comments


None yet
4 participants

gy commented Mar 14, 2012

Hello, I am trying to use the Arel#extract method. I have seen an example in a test case in test_extract.rb in the source but when I try to reproduce it in my app, I get undefined method.

table = Arel::Table.new :users
puts table[:created_at].extract('date').to_sql
=> NoMethodError: undefined method `extract' for #<Arel::Attributes::Attribute:0x7..8>

bsingr commented Oct 23, 2012

I guess you're using rails 3.2.8 with arel 3.0.2, so #extract method is not available yet.. see https://github.com/rails/arel/blob/v3.0.2/lib/arel/expressions.rb

nertzy commented May 4, 2013

Should probably close this one out by now, eh?


rafaelfranca commented May 4, 2013

True. Thank you @nertzy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment