ish_models 0.0.33.113 → 0.0.33.114

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/report.rb +4 -8
  3. data/lib/tag.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f88ffa3b0fdfca2f28fa64cfcab31fa8c68657f19f9f183b681649ad0aad7ebb
4
- data.tar.gz: af98d74b680ccc95742195e1a0810828defe53199189fc277ac4c4c35fd8f512
3
+ metadata.gz: e49713b83fbd5bb64b86dc9e10c6ac33e511ddb182358a65170ed965dd4624d6
4
+ data.tar.gz: 4e9794e42713365d9067531054ab8c948df7492a4c75f7f767a511e86be3d34e
5
5
  SHA512:
6
- metadata.gz: 48ceeba355b79e2b22c03967ab98439dce1422b472ccafb57387b11e05f6d1cefbcaeac10ead91ff8d022c633e23c12e2f74e28a856c55287f9dc57fefa17774
7
- data.tar.gz: e7c8e20330aebe8fb9047a8f37ebfa9ed8ef7332ab4d4468b2516663aed9ad7bb91edc4eca6fbae65275156efb6b29c3428adcd14e727b1ba4332597d3f38716
6
+ metadata.gz: '06599160cc8c9d000931f86b8cc921dda3192dc61b57e52ff149dffe62f1ae7980115682209a0559e328f53289f18f86069897f124093245afdb39e363c35e6a'
7
+ data.tar.gz: b907e1a5e0be37ce44c5c3f3b21103d9e113981aa9fc8e3b9e971e1b39c21b239d0bab4a0bf0e2d93f2bd32da82a2403368f6e204bcdfd5e7605b9db25cb2094
@@ -1,4 +1,4 @@
1
- class Report
1
+ class Report
2
2
  include ::Mongoid::Document
3
3
  include ::Mongoid::Timestamps
4
4
 
@@ -44,11 +44,11 @@ class Report
44
44
  field :issue
45
45
  field :subhead
46
46
 
47
- belongs_to :tag, :optional => true
48
47
  belongs_to :city, :optional => true
49
48
  belongs_to :site, :optional => true
50
49
  belongs_to :cities_user, :optional => true
51
50
 
51
+ has_and_belongs_to_many :tags
52
52
  has_and_belongs_to_many :venues
53
53
 
54
54
  has_one :photo
@@ -81,13 +81,13 @@ class Report
81
81
  end
82
82
 
83
83
  def self.not_tagged
84
- Report.where( :tag_id => nil, :city => nil )
84
+ Report.where( :tag_ids => nil, :city => nil )
85
85
  end
86
86
 
87
87
  def self.for_homepage args
88
88
  begin
89
89
  tag_ids = args[:main_tag].children_tags.map { |tag| tag._id } + [ args[:main_tag]._id ]
90
- return Report.where( :tag_id.in => tag_ids ).page args[:page]
90
+ return Report.where( :tag_ids.in => tag_ids ).page args[:page]
91
91
  rescue
92
92
  return Report.page args[:page]
93
93
  end
@@ -138,10 +138,6 @@ class Report
138
138
  end
139
139
  end
140
140
 
141
- def self.not_tagged
142
- Report.where( :tag_id => nil, :city => nil )
143
- end
144
-
145
141
  def venue
146
142
  self.venues[0] || nil
147
143
  end
data/lib/tag.rb CHANGED
@@ -16,7 +16,7 @@ class Tag
16
16
 
17
17
  field :weight, :type => Integer, :default => 10
18
18
 
19
- has_many :reports
19
+ has_and_belongs_to_many :reports
20
20
  has_many :galleries
21
21
  has_many :videos
22
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.113
4
+ version: 0.0.33.114
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox