ish_models 0.0.33.17 → 0.0.33.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af5f67105cd9a658c9da1bfed7341c91283a916c
4
- data.tar.gz: 30edc0c8af7d8ac2398b472baa5996bbfe7d4e82
3
+ metadata.gz: b609b07fe0e541e0cf8a0ffa27e7fbfacb506e61
4
+ data.tar.gz: 30a517868465f6e73bc46f9d73c1a7722ae3ae28
5
5
  SHA512:
6
- metadata.gz: 418463a134e7c49da4eed746e449587cc8d10eefb9752b5c226dc83cf05011272b5c324df9a0a49cd703aede066d945c194475ef29b35df8ff7dcd39a3608550
7
- data.tar.gz: f9bf9b4b085bb1a2aa1d1ac9e0cc4b1bd7ae0360e110ba59f0d53d70fdd19a8593297829dee87a747d822e0d89ededce42b1334dde2738fa565ae35abdd5cbd1
6
+ metadata.gz: 5021586006c10d09825173891d8bfd98e22eea5bf71743e3ceb248fb5951746572f4914eee2b1e49e094b6cf4edbdd56aecb83f7fa35780f8aa13f2b1f4be651
7
+ data.tar.gz: 2be6c015956ca93f196a6eb580550f249f67f90ff51ecc5ede25ff914884c92e91baf4d761cc4c3b32c58639dac1e51422f690bfead2e2fd740fef3fcdd6cd27
data/lib/newsitem.rb CHANGED
@@ -13,7 +13,8 @@ class Newsitem
13
13
  belongs_to :city, :optional => true
14
14
  belongs_to :report, :optional => true
15
15
  belongs_to :gallery, :optional => true
16
- has_one :video
16
+ belongs_to :video, :optional => true
17
+
17
18
  has_one :photo
18
19
 
19
20
  field :name, :type => String
data/lib/site.rb CHANGED
@@ -60,7 +60,7 @@ class Site
60
60
  # manager uses it.
61
61
  def self.list
62
62
  out = self.all.order_by( :domain => :asc, :lang => :asc )
63
- [['', nil]] + out.map { |item| [ "#{item.domain} #{item.lang}", item.id ] }
63
+ [['Select Site', nil, { :disabled => true }]] + out.map { |item| [ "#{item.domain} #{item.lang}", item.id ] }
64
64
  end
65
65
 
66
66
  def self.mobi
data/lib/venue.rb CHANGED
@@ -26,7 +26,7 @@ class Venue
26
26
  field :lang, :type => String, :default => 'en'
27
27
 
28
28
  belongs_to :city
29
- belongs_to :owner, :class_name => 'User', :inverse_of => :owned_venue
29
+ # belongs_to :owner, :class_name => 'User', :inverse_of => :owned_venue
30
30
  validates :city, :allow_nil => false, :presence => true
31
31
 
32
32
  has_and_belongs_to_many :users
@@ -45,8 +45,14 @@ class Venue
45
45
  [['', nil]] + out.map { |item| [ item.name, item.id ] }
46
46
  end
47
47
 
48
- set_callback(:create, :before) do |doc|
49
- doc.name_seo = doc.name.to_simple_string
48
+ set_callback :create, :before do |doc|
49
+ doc.name_seo = doc.name.gsub(' ', '-')
50
+ end
51
+
52
+ set_callback :save, :before do |doc|
53
+ if doc.city
54
+ city.touch
55
+ end
50
56
  end
51
57
 
52
58
  def self.types
data/lib/video.rb CHANGED
@@ -21,13 +21,13 @@ class Video
21
21
  field :youtube_id, :type => String
22
22
  validates :youtube_id, :uniqueness => true, :presence => true
23
23
 
24
- belongs_to :tag
25
- belongs_to :city
24
+ belongs_to :tag, :optional => true
25
+ belongs_to :city, :optional => true
26
26
  belongs_to :site
27
27
  validates :site, :presence => true
28
28
  belongs_to :user
29
29
  validates :user, :presence => true
30
- belongs_to :newsitem, :optional => true
30
+ has_many :newsitems
31
31
 
32
32
  accepts_nested_attributes_for :site, :tag, :city
33
33
 
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.17
4
+ version: 0.0.33.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox