Sha256: 33581d2125a8a2ff0505e9fb73552b112d26b7a28525944b60d872da5455c6a2
Contents?: true
Size: 717 Bytes
Versions: 54
Compression:
Stored size: 717 Bytes
Contents
module Para module Component class Resource < Para::Component::Base class ModelNotFound < NameError; end def model @model ||= model_type.presence && model_type.constantize rescue NameError raise ModelNotFound, "The model #{ model_type } was not found. You may need to set " + "the :model_type option in your component definition in the " + "config/components.rb file. If no component should actually " + "reference this model, you may need to run the " + "`rake para:components:clean` task to clean up your components index." end def model_table_name model && model.table_name end end end end
Version data entries
54 entries across 54 versions & 1 rubygems