Open catmando opened 6 years ago
Also support Model#load for aliased attributes like:
module ActiveRecord module InstanceMethods def load(*attributes, &block) first_time = true ReactiveRecord.load do results = attributes.collect { |attr| send("#{model._dealias_attribute(attr)}#{'!' if first_time}") } results = yield(*results) if block first_time = false block.nil? && results.count == 1 ? results.first : results end end end end
Also support Model#load for aliased attributes like: