Sha256: 4ac8b755bfcd5df345aad251caa469af04d62cd3e4f89aea70974c5cf9591ace

Contents?: true

Size: 766 Bytes

Versions: 2

Compression:

Stored size: 766 Bytes

Contents

module Storytime
  class Action < ActiveRecord::Base
    has_many :permissions
    has_many :roles, through: :permissions

    validates :guid, uniqueness: true
    validates :name, uniqueness: true

    def self.seed
      find_by(guid: "d8a1b1") || create(guid: "d8a1b1", name: "Manage Other People's Posts/Pages")
      find_by(guid: "5030ed") || create(guid: "5030ed", name: "Publish Own Posts/Pages")
      find_by(guid: "47342a") || create(guid: "47342a", name: "Manage Site Settings")
      find_by(guid: "1f7d47") || create(guid: "1f7d47", name: "Manage Users")
      find_by(guid: "5qg25i") || create(guid: "5qg25i", name: "Manage Text Snippets")
      find_by(guid: "d29d76") || create(guid: "d29d76", name: "Manage Email Subscriptions")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
storytime-1.2.0 app/models/storytime/action.rb
storytime-1.1.1 app/models/storytime/action.rb