Path: | doc/release_notes/4.4.0.txt |
Last Update: | Sun Oct 02 21:06:53 +0000 2016 |
Album.many_to_many :popular_tags, :class=>:Tag do |ds| ds.where{tags__popularity > 9000} end Album.where(:popular_tags=>[Tag[1], Tag[2]])
This will return all albums whose popular_tags would include at least one of those two tags. Previously, the block would be ignored, returning albums containing one those tags even if the tags weren‘t popular.
This can fix issues where joining another table that has columns with the same name as columns in the model table without specifying an explicit selection results in model objects being returned where the values in the model object are the values from the joined table instead of the model table.
ds.limit(nil, offset)
but this is a friendlier API.
You should no longer need to use the typecast_on_load or pg_typecast_on_load plugins when using model objects that use these types when using the jdbc/postgresql adapter.