grandstand 0.2.2 → 0.2.3

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 CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -8,11 +8,25 @@ class Post < ActiveRecord::Base
8
8
 
9
9
  class << self
10
10
  def extract_month(attribute)
11
- "strftime('%m', #{attribute})"
11
+ case configurations[Rails.env]['adapter'].to_sym
12
+ when :sqlite, :sqlite3
13
+ "strftime('%m', #{attribute})"
14
+ when :postgre, :postgres, :postgresql
15
+ "EXTRACT(month FROM #{attribute})"
16
+ when :mysql
17
+ "MONTH(#{attribute})"
18
+ end
12
19
  end
13
20
 
14
21
  def extract_year(attribute)
15
- "strftime('%Y', #{attribute})"
22
+ case configurations[Rails.env]['adapter'].to_sym
23
+ when :sqlite, :sqlite3
24
+ "strftime('%Y', #{attribute})"
25
+ when :postgre, :postgres, :postgresql
26
+ "EXTRACT(year FROM #{attribute})"
27
+ when :mysql
28
+ "YEAR(#{attribute})"
29
+ end
16
30
  end
17
31
  end
18
32
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{grandstand}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Flip Sasser"]
@@ -6,7 +6,7 @@ module Grandstand
6
6
  paths.config.routes = 'lib/routes.rb'
7
7
 
8
8
  initializer 'grandstand.add_session_extension', :after => :load_application_initializers do |app|
9
- puts "Adding middleware (#{app.config.session_options.inspect})"
9
+ # puts "Adding middleware (#{app.config.session_options.inspect})"
10
10
  app.middleware.insert_before(ActionDispatch::ShowExceptions, Grandstand::Session, app.config.session_options[:key] || app.config.session_options['key'])
11
11
  Grandstand.initialize!
12
12
  end
@@ -14,7 +14,7 @@ module Grandstand
14
14
  initializer 'grandstand.symlink_public_files' do |app|
15
15
  Dir[File.join(File.dirname(__FILE__), '..', 'public', '*')].each do |gem_path|
16
16
  user_path = File.join(app.root, 'public', File.basename(gem_path))
17
- puts "Copying #{gem_path} to #{user_path}"
17
+ # puts "Copying #{gem_path} to #{user_path}"
18
18
  if File.file?(gem_path) && !File.file?(user_path)
19
19
  FileUtils.cp_r(gem_path, user_path)
20
20
  elsif File.directory?(gem_path) && !File.directory?(user_path)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grandstand
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Flip Sasser