有什么方法可以支持 Rails 4 语法在 Rails 3.2 中定义关联?
我目前有以下 Rails 4 语法:
has_many :clients, -> { where("client_type = 'temp'").order("name DESC") }, through: :user
我希望我的 Rails 3.2 应用程序支持该语法。本质上,就好像我在 Rails 3.2 中编写了以下内容:
has_many :clients, conditions: "client_type = 'temp'", order: "name DESC", through: :user
是否有支持这种支持的库/宝石?关于如何做到这一点的任何想法?