I have a model 'Car'. Its structure looks like this.
Car
=========
Make:string
Year:integer
Before, I learned that some methods in ruby, especially active record's, actually take an array as parameter.
Then, instead of finding a collection in traditional way:
Car.find(:all, :limit => 10, :offset => 5)
Can I perform searching the collection like this?
Car.find([:all, {:limit => 10, :offset => 5}])
I have tried above in the console, but it didn't work for me. I'm just curious to know why it didn't work the way it was supposed to be.
any advice would be really appreciated.
You can not pass the argument like array, its predefined for ids. like:
Car.find([1,2,3,4,5])
Have a look on link : http://apidock.com/rails/ActiveRecord/Base/find/class