caboose-cms 0.2.91 → 0.2.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/caboose/engine.rb +28 -0
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose_db.rake +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDg5OTM1Yzk0MjAxZGU5MDViZjIzZDc2ODFhZTg2ZDcxZWRmYjlmMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDdmZjlkYmIzYzI2NjExMWRjZGY2NmFmMWY0OTcxNDM0NWVmNjc5Ng==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmNiNjFhNzg4ZWFlMjlhM2M0YTY1ZDJmYzc4MzNiOTkyMGE2OGI3YmY1Yjdl
|
10
|
+
NWFjY2VjYjYyYzcxNWNjOGFlZDIwOWVkMWViMDM1NTVhMjcwMDQzNzNkOTZm
|
11
|
+
M2FhZDVkN2M0OTc1NDliYmViZGRjY2YwMmIzZjg2Yzk4OWVkOGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzE1M2Y0OTZmY2M1ZWVkYmY5ZjhiMmU5NmU3YjVkOGFkNDQzOTAwOTczMTZm
|
14
|
+
MjZiNmYwN2IxZjIwMjAyMDNhN2UyNmRkZDMxYmQwYTY0OGFiZGE2OTAxODhk
|
15
|
+
MTkwZTA2MDAwNWJjM2QwM2Y4ZjU0YzM4YjBmY2JjYzc0ODFmZTE=
|
data/lib/caboose/engine.rb
CHANGED
@@ -49,6 +49,34 @@ module Caboose
|
|
49
49
|
return obj.to_json
|
50
50
|
end
|
51
51
|
|
52
|
+
def Caboose.create_schema(schema_file)
|
53
|
+
c = ActiveRecord::Base.connection
|
54
|
+
require schema_file
|
55
|
+
@schema.each do |table, columns|
|
56
|
+
c.create_table table if !c.table_exists?(table)
|
57
|
+
columns.each do |col|
|
58
|
+
|
59
|
+
# Skip if the column exists with the proper data type
|
60
|
+
next if c.column_exists?(table, col[0], col[1])
|
61
|
+
|
62
|
+
# If the column exists, but not with the correct data type, try to change it
|
63
|
+
if c.column_exists?(table, col[0])
|
64
|
+
if col.count > 2
|
65
|
+
c.change_column table, col[0], col[1], col[2]
|
66
|
+
else
|
67
|
+
c.change_column table, col[0], col[1]
|
68
|
+
end
|
69
|
+
else
|
70
|
+
if col.count > 2
|
71
|
+
c.add_column table, col[0], col[1], col[2]
|
72
|
+
else
|
73
|
+
c.add_column table, col[0], col[1]
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
52
80
|
class Engine < ::Rails::Engine
|
53
81
|
isolate_namespace Caboose
|
54
82
|
end
|
data/lib/caboose/version.rb
CHANGED
data/lib/tasks/caboose_db.rake
CHANGED
@@ -127,7 +127,7 @@ namespace :caboose do
|
|
127
127
|
|
128
128
|
# Post categories
|
129
129
|
c.create_table :post_categories if !c.table_exists?(:post_categories)
|
130
|
-
c.add_column :
|
130
|
+
c.add_column :post_categories, :name , :string if !c.column_exists?(:post_categories, :name)
|
131
131
|
|
132
132
|
# Post category membership
|
133
133
|
c.create_table :post_category_memberships if !c.table_exists?(:post_category_memberships)
|
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.2.
|
4
|
+
version: 0.2.92
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|