printing_press 0.2.0 → 0.2.1
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.
- data/VERSION +1 -1
- data/lib/printing_press/publishable.rb +8 -2
- metadata +4 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.1
|
|
@@ -20,16 +20,22 @@ module PrintingPress
|
|
|
20
20
|
|
|
21
21
|
def printing_press_off
|
|
22
22
|
self.printing_press_enabled_for_model = false
|
|
23
|
-
set_table_name reset_table_name
|
|
24
23
|
self.reset_column_information
|
|
25
24
|
end
|
|
26
25
|
|
|
27
26
|
def printing_press_on
|
|
28
27
|
self.printing_press_enabled_for_model = true
|
|
29
|
-
set_table_name self.published_table_name
|
|
30
28
|
self.reset_column_information
|
|
31
29
|
end
|
|
32
30
|
|
|
31
|
+
def table_name
|
|
32
|
+
if self.printing_press_enabled_for_model
|
|
33
|
+
self.published_table_name
|
|
34
|
+
else
|
|
35
|
+
self.reset_table_name
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
33
39
|
def drafts
|
|
34
40
|
self.find_by_sql("SELECT o.* FROM #{self.reset_table_name} o, #{self.published_table_name} p WHERE (o.id = p.id AND o.updated_at != p.updated_at)") +
|
|
35
41
|
self.find_by_sql("SELECT * FROM #{self.reset_table_name} WHERE id NOT IN (SELECT id FROM #{self.published_table_name}) GROUP BY id")
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: printing_press
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 21
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 2
|
|
9
|
-
-
|
|
10
|
-
version: 0.2.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.2.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Edmond Leung
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-11-
|
|
18
|
+
date: 2011-11-21 00:00:00 -05:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|