lib/comicvine/mongo.rb in comicvine-mongo-0.1.1 vs lib/comicvine/mongo.rb in comicvine-mongo-0.1.2

- old
+ new

@@ -224,11 +224,11 @@ has_and_belongs_to_many :locations, class_name: 'ComicVine::Resource::Location', inverse_of: :volume_credits, validate: false has_and_belongs_to_many :objects, class_name: 'ComicVine::Resource::Object', inverse_of: :volume_credits, validate: false has_and_belongs_to_many :people, class_name: 'ComicVine::Resource::Person', inverse_of: :volume_credits, validate: false - belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :volumes, validate: false + belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :volumes, validate: false, optional: true end ## # Extends {ComicVine::Resource::Character} to add mongoid functions @@ -264,11 +264,11 @@ has_and_belongs_to_many :issues_died_in, class_name: 'ComicVine::Resource::Issue', inverse_of: :character_died_in, validate: false has_and_belongs_to_many :movies, class_name: 'ComicVine::Resource::Movie', inverse_of: :characters, validate: false has_and_belongs_to_many :powers, class_name: 'ComicVine::Resource::Power', inverse_of: :characters, validate: false - belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :characters, validate: false + belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :characters, validate: false, optional: true has_and_belongs_to_many :story_arc_credits, class_name: 'ComicVine::Resource::StoryArc', inverse_of: :characters, validate: false has_and_belongs_to_many :team_enemies, class_name: 'ComicVine::Resource::Team', inverse_of: nil, validate: false has_and_belongs_to_many :team_friends, class_name: 'ComicVine::Resource::Team', inverse_of: nil, validate: false has_and_belongs_to_many :teams, class_name: 'ComicVine::Resource::Team', inverse_of: :characters, validate: false @@ -377,11 +377,11 @@ has_and_belongs_to_many :object_credits, class_name: 'ComicVine::Resource::Object', inverse_of: nil, validate: false has_and_belongs_to_many :person_credits, class_name: 'ComicVine::Resource::Person', inverse_of: nil, validate: false has_and_belongs_to_many :team_credits, class_name: 'ComicVine::Resource::Team', inverse_of: nil, validate: false has_and_belongs_to_many :story_arc_credits, class_name: 'ComicVine::Resource::StoryArc', inverse_of: :episodes, validate: false - belongs_to :series, class_name: 'ComicVine::Resource::Series', inverse_of: :episodes, validate: false + belongs_to :series, class_name: 'ComicVine::Resource::Series', inverse_of: :episodes, validate: false, optional: true end ## # Extends {ComicVine::Resource::Location} to add mongoid functions # @since 0.1.2 @@ -665,11 +665,11 @@ has_many :episodes, class_name: 'ComicVine::Resource::Episode', inverse_of: :series, validate: false has_one :first_episode, class_name: 'ComicVine::Resource::Episode', validate: false has_one :last_episode, class_name: 'ComicVine::Resource::Episode', validate: false has_and_belongs_to_many :location_credits, class_name: 'ComicVine::Resource::Location', inverse_of: nil, validate: false - belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :series, validate: false + belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :series, validate: false, optional: true end ## # Extends {ComicVine::Resource::StoryArc} to add mongoid functions # @since 0.1.2 @@ -697,11 +697,11 @@ def count_of_isssue_appearances self[:count_of_isssue_appearances] end - belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :story_arcs, validate: false + belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :story_arcs, validate: false, optional: true belongs_to :first_appeared_in_issue, class_name: 'ComicVine::Resource::Issue', inverse_of: :first_appearance_storyarcs, validate: false, optional: true has_and_belongs_to_many :issues, class_name: 'ComicVine::Resource::Issue', inverse_of: :story_arc_credits, validate: false has_and_belongs_to_many :movies, class_name: 'ComicVine::Resource::Movie', inverse_of: :story_arc_credits, validate: false @@ -770,10 +770,10 @@ belongs_to :first_appeared_in_issue, class_name: 'ComicVine::Resource::Issue', inverse_of: :first_appearance_teams, validate: false, optional: true has_and_belongs_to_many :issue_credits, class_name: 'ComicVine::Resource::Issue', inverse_of: :team_credits, validate: false has_and_belongs_to_many :issues_disbanded_in, class_name: 'ComicVine::Resource::Issue', inverse_of: :team_disbanded_in, validate: false - belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :teams, validate: false + belongs_to :publisher, class_name: 'ComicVine::Resource::Publisher', inverse_of: :teams, validate: false, optional: true has_and_belongs_to_many :movies, class_name: 'ComicVine::Resource::Movie', inverse_of: :teams, validate: false has_and_belongs_to_many :story_arc_credits, class_name: 'ComicVine::Resource::StoryArc', inverse_of: :teams, validate: false has_and_belongs_to_many :volume_credits, class_name: 'ComicVine::Resource::Volume', inverse_of: :teams, validate: false end