refinerycms-calendar 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/app/models/event.rb CHANGED
@@ -9,12 +9,6 @@ class Event < ActiveRecord::Base
9
9
  scope :featured, where(['featured IS NOT NULL and featured = ?', true])
10
10
  scope :not_featured, where(['featured IS NULL or featured = ?', false])
11
11
  scope :live, where(['end_at > ?', Time.now])
12
- scope :archive, where(['end_at < ?', Time.now])
13
- scope :for_archive_list, where(['end_at < ?', Time.now.beginning_of_month])
14
-
15
- scope :by_archive, lambda { |archive_date|
16
- where(['start_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month])
17
- }
18
12
 
19
13
  scope :by_year, lambda { |archive_year|
20
14
  where(['start_at between ? and ?', archive_year.beginning_of_year, archive_year.end_of_year])
@@ -61,6 +55,18 @@ class Event < ActiveRecord::Base
61
55
  Event.where(['end_at >= ? AND start_at < ?', Time.now, self.start_at]).reverse.first
62
56
  end
63
57
 
58
+ def self.archive
59
+ with_exclusive_scope { order('start_at DESC').where 'end_at < ?', Time.now }
60
+ end
61
+
62
+ def self.by_archive archive_date
63
+ with_exclusive_scope { order('start_at DESC').where 'start_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month }
64
+ end
65
+
66
+ def self.for_archive_list
67
+ with_exclusive_scope { order('start_at DESC').where(['end_at < ?', Time.now.beginning_of_month]) }
68
+ end
69
+
64
70
  private
65
71
 
66
72
  def ends_after_start
data/changelog.md CHANGED
@@ -1,4 +1,8 @@
1
1
 
2
+ ## 1.0.4 [02 June 2011]
3
+ * Archive listing should be reversed
4
+
5
+
2
6
  ## 1.0 [13 March 2011]
3
7
 
4
8
  * Venue Details
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = 'refinerycms-calendar'
4
- s.version = '1.0.2'
4
+ s.version = '1.0.4'
5
5
  s.description = 'Ruby on Rails Events engine for Refinery CMS'
6
- s.date = '2011-03-03'
6
+ s.date = Time.now.strftime('%Y-%m-%d')
7
7
  s.summary = 'Events engine for Refinery CMS'
8
8
  s.require_paths = %w(lib)
9
9
  s.files = Dir['**/*']
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.email = %q{joe@neotericdesign.com}
12
12
  s.homepage = "https://github.com/resolve/refinerycms-calendar"
13
13
 
14
- s.add_dependency 'refinerycms', '>= 0.9.9'
14
+ s.add_dependency 'refinerycms-core', '>= 0.9.9.1'
15
15
  end
16
16
 
17
17
 
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-calendar
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 0
8
- - 2
9
- version: 1.0.2
4
+ prerelease:
5
+ version: 1.0.4
10
6
  platform: ruby
11
7
  authors:
12
8
  - Neoteric Design
@@ -16,22 +12,18 @@ autorequire:
16
12
  bindir: bin
17
13
  cert_chain: []
18
14
 
19
- date: 2011-03-03 00:00:00 -06:00
15
+ date: 2011-06-02 00:00:00 -05:00
20
16
  default_executable:
21
17
  dependencies:
22
18
  - !ruby/object:Gem::Dependency
23
- name: refinerycms
19
+ name: refinerycms-core
24
20
  prerelease: false
25
21
  requirement: &id001 !ruby/object:Gem::Requirement
26
22
  none: false
27
23
  requirements:
28
24
  - - ">="
29
25
  - !ruby/object:Gem::Version
30
- segments:
31
- - 0
32
- - 9
33
- - 9
34
- version: 0.9.9
26
+ version: 0.9.9.1
35
27
  type: :runtime
36
28
  version_requirements: *id001
37
29
  description: Ruby on Rails Events engine for Refinery CMS
@@ -113,21 +105,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
105
  requirements:
114
106
  - - ">="
115
107
  - !ruby/object:Gem::Version
116
- segments:
117
- - 0
118
108
  version: "0"
119
109
  required_rubygems_version: !ruby/object:Gem::Requirement
120
110
  none: false
121
111
  requirements:
122
112
  - - ">="
123
113
  - !ruby/object:Gem::Version
124
- segments:
125
- - 0
126
114
  version: "0"
127
115
  requirements: []
128
116
 
129
117
  rubyforge_project:
130
- rubygems_version: 1.3.7
118
+ rubygems_version: 1.6.2
131
119
  signing_key:
132
120
  specification_version: 3
133
121
  summary: Events engine for Refinery CMS