grandstand 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/models/post.rb +16 -2
- data/grandstand.gemspec +1 -1
- data/lib/grandstand/application.rb +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/app/models/post.rb
CHANGED
@@ -8,11 +8,25 @@ class Post < ActiveRecord::Base
|
|
8
8
|
|
9
9
|
class << self
|
10
10
|
def extract_month(attribute)
|
11
|
-
|
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
|
-
|
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
|
|
data/grandstand.gemspec
CHANGED
@@ -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:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Flip Sasser
|