Sha256: 1133878489eb2088cf6371bb15d3fa07787f67be4dc94ee2373b58908199d04b
Contents?: true
Size: 335 Bytes
Versions: 52
Compression:
Stored size: 335 Bytes
Contents
module ActionView 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