Right now the following code would produce an error:
class ProductFilter
include ActiveModel::Validations
validates :min_price, numericality: { allow_nil: true }
validates :max_price, numericality: { allow_nil: true, greater_than:
:min_price }
end
ProductFilter.new(max_price: 100).valid?
Hi Lucas!
I have a PR for that - https://github.com/rails/rails/pull/34935, but it
hasn't been reviewed yet :(
On Thursday, 31 January 2019 19:42:04 UTC+3, Lucas Minissale wrote:
>
> Hello,
>
> Did you get anywhere with this?
>
> According to what I have been reading, it is currently not possib
Hi Josh!
There is a number of gems that can do this (or similar) thing for you:
- https://github.com/DmitryTsepelev/store_model
- https://github.com/palkan/store_attribute
- https://github.com/marshall-lee/nested_record
On Wednesday, 2 October 2019 05:23:14 UTC+3, Josh Marchello wrote:
>
> I'm c