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

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -