ish_models 0.0.33.59 → 0.0.33.60
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/city.rb +1 -0
- data/lib/event.rb +7 -1
- data/lib/ish_models/user_profile.rb +3 -1
- data/lib/photo.rb +3 -1
- data/lib/tag.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ab026ee82cfb953e027cac14561792a73a77af1
|
4
|
+
data.tar.gz: 00160f91bc7a972cc62ba1750ac689729c5ead6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d073777ea3d009e46a340845a40180a08cc57bbfdbf335b49ecfff4659700d8dc4521be2dc65ce0865af6aa5b7511786d61947454e846047266dac18e12607f7
|
7
|
+
data.tar.gz: 0a1e6af0221895b656ca943f28653b6f474339298635dbb422ae305d730170589b0c331b932d53372a3db210a5600d9360c25a673981b45245064d96155452b5
|
data/lib/city.rb
CHANGED
@@ -31,6 +31,7 @@ class City
|
|
31
31
|
has_many :reports
|
32
32
|
has_many :venues
|
33
33
|
has_many :videos
|
34
|
+
has_many :tags
|
34
35
|
has_many :current_users, :class_name => '::IshModels::UserProfile', :inverse_of => :current_city
|
35
36
|
|
36
37
|
has_one :profile_photo, :class_name => 'Photo', :inverse_of => :profile_city
|
data/lib/event.rb
CHANGED
@@ -17,6 +17,12 @@ class Event
|
|
17
17
|
|
18
18
|
belongs_to :city
|
19
19
|
validates :city, :presence => true
|
20
|
-
|
20
|
+
|
21
|
+
field :x, :type => Float
|
22
|
+
field :y, :type => Float
|
23
|
+
|
24
|
+
has_one :profile_photo, :class_name => 'Photo', :inverse_of => :profile_event
|
25
|
+
has_many :photos
|
26
|
+
|
21
27
|
end
|
22
28
|
|
@@ -2,9 +2,11 @@ class IshModels::UserProfile
|
|
2
2
|
include Mongoid::Document
|
3
3
|
include Mongoid::Timestamps
|
4
4
|
|
5
|
-
field :name
|
5
|
+
field :name
|
6
6
|
validates_presence_of :name
|
7
7
|
|
8
|
+
field :username
|
9
|
+
|
8
10
|
field :email
|
9
11
|
# validates_format_of :email, :with => ::Devise::email_regexp
|
10
12
|
validates_format_of :email,:with => /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
|
data/lib/photo.rb
CHANGED
@@ -15,11 +15,13 @@ class Photo
|
|
15
15
|
def user; user_profile; end
|
16
16
|
belongs_to :profile_city, :class_name => 'City', :inverse_of => :profile_photo, :optional => true
|
17
17
|
belongs_to :profile_venue, :class_name => 'Venue', :inverse_of => :profile_photo, :optional => true
|
18
|
+
belongs_to :profile_event, :class_name => 'Event', :inverse_of => :profile_photo, :optional => true
|
18
19
|
|
19
20
|
belongs_to :report, :optional => true
|
20
21
|
belongs_to :venue, :optional => true
|
22
|
+
belongs_to :event, :optional => true
|
21
23
|
belongs_to :feature, :optional => true
|
22
|
-
belongs_to :gallery, :optional => true
|
24
|
+
belongs_to :gallery, :optional => true
|
23
25
|
belongs_to :newsitem, :optional => true
|
24
26
|
|
25
27
|
field :name, :type => String
|
data/lib/tag.rb
CHANGED
@@ -3,7 +3,7 @@ class Tag
|
|
3
3
|
include Mongoid::Timestamps
|
4
4
|
|
5
5
|
field :name, :type => String
|
6
|
-
validates :name, :uniqueness => true, :allow_nil => false
|
6
|
+
# validates :name, :uniqueness => true, :allow_nil => false
|
7
7
|
|
8
8
|
field :name_seo, :as => :tagname
|
9
9
|
validates :name_seo, :uniqueness => true, :allow_nil => false
|
@@ -28,6 +28,7 @@ class Tag
|
|
28
28
|
has_many :newsitems
|
29
29
|
|
30
30
|
belongs_to :site, :optional => true
|
31
|
+
belongs_to :city, :optional => true
|
31
32
|
|
32
33
|
default_scope ->{
|
33
34
|
where({ :is_public => true, :is_trash => false }).order_by({ :name => :asc })
|