Sha256: b051b864341cf03bcaa1e18919d03cc4cfddc71bc6588328117ecbcf4a0db215
Contents?: true
Size: 320 Bytes
Versions: 42
Compression:
Stored size: 320 Bytes
Contents
class Role < ActiveRecord::Base has_and_belongs_to_many :users before_validation :camelize_title validates :title, :uniqueness => true def camelize_title(role_title = self.title) self.title = role_title.to_s.camelize end def self.[](title) find_or_create_by_title(title.to_s.camelize) end end
Version data entries
42 entries across 42 versions & 2 rubygems