In Rails while using the `where` method, how to match only the year and month? -
In Rails while using the `where` method, how to match only the year and month? -
normally, select records same date utilize :
bronze.where(regdate: date.new(2014,03,03))
how can utilize select year , month?
for month be:
date = # set date here bronze.where(regdate: date.beginning_of_month...date.beginning_of_month + 1.month)
analogically year.
ruby-on-rails ruby-on-rails-4
Comments
Post a Comment