[Rails] Re: filter dates from where clause

2017-01-29 Thread jim
ActiveRecord will handle converting a Time into something your database understands, so you don't need to worry about that. You can also write the where clause manually like you did, or you can use arel, which would be my preference. You can also chain .where()'s, since they just return

[Rails] Re: filter dates from where clause

2017-01-29 Thread Joe Guerra
On Sunday, January 29, 2017 at 1:29:03 PM UTC-5, Joe Guerra wrote: > > I'm trying to figure out how to compare my enddate > Time.now in my where > clause. > > enddate is a date field, I'm just trying to only display products that > haven't expired (by the date field). > > > I've tried... > >

[Rails] filter dates from where clause

2017-01-29 Thread Joe Guerra
I'm trying to figure out how to compare my enddate > Time.now in my where clause. enddate is a date field, I'm just trying to only display products that haven't expired (by the date field). I've tried... require 'time' products.where(['enddate > ?', Time.now]) -- You received this

Re: [Rails] Need help for writing Api in Rails 5

2017-01-29 Thread Hassan Schroeder
On Sat, Jan 28, 2017 at 11:44 PM, Tushar Garg wrote: > Those errors were related testing. Becoz lot of things in Rspec are > depriciated, when I remove Rspec and testing part from it, then its working > fine. But "removing testing" to make it "work" is an extremely