ernie/ransack — Issue #50: ransacker with DATE_FORMAT(colum_name, '%m')
Author: tulak
Created: 2011-12-21 23:42:08+00:00
State: open

How can I make a ransacker which will find records while calling DATE_FORMAT sql function?
I had this done on MetaWhere 1.x like this:

```ruby
scope :calldate_day, lambda {|p|
p = "%02d" % p
where("DATE_FORMAT(calldate, '%d')='#{p}'")
}
scope :calldate_month, lambda {|p|
p = "%02d" % p
where("DATE_FORMAT(calldate, '%m')='#{p}'")
}
scope :calldate_year, lambda {|p|
where("DATE_FORMAT(calldate, '%Y')='#{p}'")
}
search_methods :calldate_day, :calldate_month, :calldate_year
```

but have no idea how to do this with ransacker method