-
-
Save drusepth/d31802c5ac2b6c070b86dca4a5b2519c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Character < ActiveRecord::Base | |
validates :name, presence: true | |
belongs_to :user | |
validates :user_id, presence: true | |
include BelongsToUniverse | |
include HasAttributes | |
include HasPrivacy | |
include HasContentGroupers | |
include HasImageUploads | |
include Serendipitous::Concern | |
include Authority::Abilities | |
self.authorizer_name = 'CoreContentAuthorizer' | |
# Characters | |
relates :fathers, with: :fatherships | |
relates :mothers, with: :motherships | |
relates :siblings, with: :siblingships | |
relates :spouses, with: :marriages | |
relates :children, with: :childrenships | |
relates :best_friends, with: :best_friendships | |
relates :archenemies, with: :archenemyship | |
# Locations | |
relates :birthplaces, with: :birthings | |
# Races | |
relates :races, with: :raceships | |
# Languages | |
relates :spoken_languages, with: :lingualisms | |
def description | |
role | |
end | |
def self.content_name | |
'character' | |
end | |
def self.color | |
'red' | |
end | |
def self.icon | |
'group' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment