almost-happy 0.4.0 → 0.4.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/almost-happy.gemspec +2 -2
- data/lib/almost_happy/scopeable.rb +4 -4
- data/lib/almost_happy.rb +1 -1
- metadata +4 -4
data/almost-happy.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{almost-happy}
|
|
8
|
-
s.version = "0.4.
|
|
8
|
+
s.version = "0.4.1"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Darcy Laycock"]
|
|
12
|
-
s.date = %q{2010-12-
|
|
12
|
+
s.date = %q{2010-12-22}
|
|
13
13
|
s.description = %q{Helpers, convertors etc for Rails 3 to make page / post models for simple cases simple}
|
|
14
14
|
s.email = %q{sutto@sutto.net}
|
|
15
15
|
s.extra_rdoc_files = [
|
|
@@ -5,19 +5,19 @@ module AlmostHappy
|
|
|
5
5
|
module ClassMethods
|
|
6
6
|
|
|
7
7
|
def published
|
|
8
|
-
where
|
|
8
|
+
where "#{quoted_table_name}.published_at IS NOT NULL AND #{quoted_table_name}.published_at <= ?", Time.now
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def unpublished
|
|
12
|
-
where
|
|
12
|
+
where "#{quoted_table_name}.published_at IS NULL OR #{quoted_table_name}.published_at > ?", Time.now
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def ordered
|
|
16
|
-
order
|
|
16
|
+
order "#{quoted_table_name}.published_at DESC"
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def ordered_for_preview
|
|
20
|
-
order
|
|
20
|
+
order "(#{quoted_table_name}.published_at IS NULL) DESC, #{quoted_table_name}.published_at DESC"
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
end
|
data/lib/almost_happy.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: almost-happy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 13
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 4
|
|
9
|
-
-
|
|
10
|
-
version: 0.4.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.4.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Darcy Laycock
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2010-12-
|
|
18
|
+
date: 2010-12-22 00:00:00 +08:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|