Sha256: 84c83fec0c847eecc232b4b97ba51eadbe5cb3ff04024c19731d0c5b5793dd7b
Contents?: true
Size: 341 Bytes
Versions: 52
Compression:
Stored size: 341 Bytes
Contents
module ActionController module ModelNaming # Converts the given object to an ActiveModel compliant one. def convert_to_model(object) object.respond_to?(:to_model) ? object.to_model : object end def model_name_from_record_or_class(record_or_class) convert_to_model(record_or_class).model_name end end end
Version data entries
52 entries across 51 versions & 8 rubygems