Sha256: b8ada4243325f32d31d7bff606840c51bdd304e84a4125db9ff68b95200b6869
Contents?: true
Size: 646 Bytes
Versions: 21
Compression:
Stored size: 646 Bytes
Contents
class String def extract_settings split(",").map { |x| x.strip } end def remove_prefix split("/")[1..-1].join("/") end def extract_class remove_prefix.classify.typus_constantize end def typus_constantize Typus::Configuration.models_constantized[self] end def acl_action_mapper case self when "new", "create" "create" when "index", "show", "autocomplete" "read" when "edit", "update", "position", "toggle", "relate", "unrelate" "update" when "destroy", "trash" "delete" else self end end def to_resource self.underscore.pluralize end end
Version data entries
21 entries across 21 versions & 1 rubygems