caboose-cms 0.4.113 → 0.4.114

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTUyMWFmMjc2ZDkyODAxMWVjNTg4ODAzOTQyZTkyMGY2YmQzM2MwNg==
4
+ ZjNmNDgyNjU5YjI0ODRkOTdhZTQwZDRiZDUyMDEzMjUyODlhYjIxMA==
5
5
  data.tar.gz: !binary |-
6
- OTkyMTliNGQ5NGM4MzJjMGY2ODZiMmExYTA3NTg2NGU2YmZlMTFiOQ==
6
+ YzhmMDRlNzliMzM3M2JlNjg5MjZkNjRiOTA1OGRhMDNmNWUxMzM3ZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NmExZGQ1ZGYwMDA5OGRhMzk0N2M4MzI2YWZlYThlM2Y2ZDI0OWI2ZDNhM2M4
10
- MDgxZWM2N2NhMjFkOWQ0YzkyMjE3NWRkYTQ2NTYxYmJlYzE1YmMzOGUzOGMx
11
- OTlhYjZlN2MyZDA0ZjJlZDhhMzdhMTkzYmYxNDU1OWIzNDU3MGE=
9
+ ODg2NjIxZGFjYzdlNDczMDUzNWE0NDFhZDJhYmM5MzI5MWVlNmIwMzhmNmRm
10
+ MjFlYjc0MmU0NjU4ZTM0NDlkMmEzZTdlMTM3OTdhN2M1OTU0Zjc0ZGRiYjRj
11
+ ZmQ2MDBiOGM0MWY3NzNlMzFmZmViOTVkZDUyMDFhZGU5MmU0Yjc=
12
12
  data.tar.gz: !binary |-
13
- MjI3ZmQ1NjRhZTA3ODMyMmNiYmE0ZTEzY2YxMjg3YTMyYWY1NDBkYzliMTFj
14
- MDc3ZTgzNzdjMDI0OTVjOGQ0ODIxZmRmYmNjMGVkM2IzYzhkYzRiZWVjYTRm
15
- NTgwMDMxNGVmMWIxNDQyZTMyNzMwNjQ2OGMzYjBmMTRhZjM1NDE=
13
+ NmU5N2Q2ZGNkMjhmNDBiMjc5ZWZmMDJmYjBkMzY5ZmM5YzNmOWU1MTA5MTE0
14
+ Mjg0OTU5ODlmMjFiOGFkZWU4YjU3MzVlYmQ4ZDRkNDAwMGIyZTA4YjliMDYz
15
+ Nzg1MWRhMjQzODYxZTA5NDIzZWVlNTZkZjVhMWU3MDBjN2E1Y2Y=
@@ -26,7 +26,8 @@ module Caboose
26
26
  return if !user_is_allowed('posts', 'view')
27
27
 
28
28
  @gen = Caboose::PageBarGenerator.new(params, {
29
- 'name' => ''
29
+ 'site_id' => @site.id,
30
+ 'name' => ''
30
31
  },{
31
32
  'model' => 'Caboose::Post',
32
33
  'sort' => 'created_at DESC',
@@ -55,7 +56,11 @@ module Caboose
55
56
  def admin_edit_categories
56
57
  return if !user_is_allowed('posts', 'edit')
57
58
  @post = Post.find(params[:id])
58
- @categories = PostCategory.reorder(:name).all
59
+ @categories = PostCategory.where(:site_id => @site.id).reorder(:name).all
60
+ if @categories.nil? || @categories.count == 0
61
+ PostCategory.create(:site_id => @site.id, :name => 'General News')
62
+ @categories = PostCategory.where(:site_id => @site.id).reorder(:name).all
63
+ end
59
64
  render :layout => 'caboose/admin'
60
65
  end
61
66
 
@@ -114,6 +119,7 @@ module Caboose
114
119
  })
115
120
 
116
121
  post = Post.new
122
+ post.site_id = @site.id
117
123
  post.title = params[:title]
118
124
  post.published = false
119
125
 
@@ -4,8 +4,10 @@ class Caboose::Post < ActiveRecord::Base
4
4
 
5
5
  has_many :post_category_memberships
6
6
  has_many :post_categories, :through => :post_category_memberships
7
-
8
- attr_accessible :id,
7
+ belongs_to :site
8
+
9
+ attr_accessible :id,
10
+ :site_id,
9
11
  :category_id,
10
12
  :title,
11
13
  :body,
@@ -5,6 +5,6 @@ class Caboose::PostCategory < ActiveRecord::Base
5
5
  has_many :post_category_memberships
6
6
  has_many :posts, :through => :post_category_memberships
7
7
 
8
- attr_accessible :id, :name
8
+ attr_accessible :id, :site_id, :name
9
9
 
10
10
  end
@@ -244,17 +244,19 @@ class Caboose::Schema < Caboose::Utilities::Schema
244
244
  [ :action , :string ]
245
245
  ],
246
246
  Caboose::Post => [
247
+ [ :site_id , :integer ],
247
248
  [ :title , :text ],
248
- [ :body , :text ],
249
+ [ :body , :text ],
249
250
  [ :hide , :boolean ],
250
- [ :image_url , :text ],
251
+ [ :image_url , :text ],
251
252
  [ :published , :boolean ],
252
253
  [ :created_at , :datetime ],
253
254
  [ :updated_at , :datetime ],
254
255
  [ :image , :attachment ]
255
256
  ],
256
257
  Caboose::PostCategory => [
257
- [ :name , :string ]
258
+ [ :site_id , :integer ],
259
+ [ :name , :string ]
258
260
  ],
259
261
  Caboose::PostCategoryMembership => [
260
262
  [ :post_id , :integer ],
@@ -4,6 +4,7 @@ class Caboose::Site < ActiveRecord::Base
4
4
 
5
5
  has_many :site_memberships, :class_name => 'Caboose::SiteMembership', :dependent => :delete_all
6
6
  has_many :domains, :class_name => 'Caboose::Domain', :dependent => :delete_all
7
+ has_many :post_categories, :class_name => 'Caboose::PostCategory'
7
8
  attr_accessible :id, :name, :description
8
9
 
9
10
  def smtp_config
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.4.113'
2
+ VERSION = '0.4.114'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.113
4
+ version: 0.4.114
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-17 00:00:00.000000000 Z
11
+ date: 2014-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails