Sha256: 6e0ba98348ee68d2ac3cd9de9f9667bdf9d7286274a773068a12a39144b05296

Contents?: true

Size: 674 Bytes

Versions: 6

Compression:

Stored size: 674 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")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
storytime-1.0.7 app/models/storytime/action.rb
storytime-1.0.6 app/models/storytime/action.rb
storytime-1.0.5 app/models/storytime/action.rb
storytime-1.0.2 app/models/storytime/action.rb
storytime-1.0.1 app/models/storytime/action.rb
storytime-1.0.0 app/models/storytime/action.rb