Skip to content

Commit

Permalink
support mongoid 7.0
Browse files Browse the repository at this point in the history
* specify class name of reletions
  • Loading branch information
tdtds committed Jun 25, 2019
1 parent 01f35dd commit f6e4bd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/tdiary/io/mongodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Comment
include Mongoid::Timestamps
store_in collection: "comments"

belongs_to :diary
belongs_to :diary, class_name: 'TDiary::IO::MongoDB::Diary'
field :name, type: String
field :mail, type: String
field :body, type: String
Expand Down Expand Up @@ -61,8 +61,8 @@ class Diary
field :style, type: String
field :last_modified, type: Integer
field :visible, type: Boolean
has_many :comments, autosave: true
has_many :referers, autosave: true
has_many :comments, autosave: true, class_name: 'TDiary::IO::MongoDB::Comment'
has_many :referers, autosave: true, class_name: 'TDiary::IO::MongoDB::Referer'

index({diary_id: 1}, {unique: true})
index({year: 1, month: 1})
Expand Down
2 changes: 1 addition & 1 deletion tdiary-io-mongodb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency "mongoid", "~> 6.0"
spec.add_dependency "mongoid", "~> 7.0"
spec.add_dependency "hikidoc"
spec.add_dependency "tdiary", ">= 5.0"

Expand Down

0 comments on commit f6e4bd5

Please sign in to comment.