go_gamification 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/go_gamification/application_helper.rb +1 -0
- data/app/uploaders/go_gamification/image_uploader.rb +12 -4
- data/app/views/go_gamification/rewards/_presentation.html.erb +5 -0
- data/app/views/go_gamification/rewards/_reward.html.erb +5 -5
- data/db/migrate/20171020181620_create_go_gamification_scorings.rb +3 -2
- data/db/migrate/20171020182027_rename_everything.rb +1 -1
- data/db/migrate/20171020182248_rename_go_gamification_tasks_to_goals.rb +1 -1
- data/lib/go_gamification/engine.rb +17 -10
- data/lib/go_gamification/version.rb +1 -1
- data/lib/{go_gamefication.rb → go_gamification.rb} +0 -0
- data/lib/tasks/{go_gamefication_tasks.rake → go_gamification_tasks.rake} +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2652a99ab1f5d6d960aee80377811d06a19d44ae
|
4
|
+
data.tar.gz: 04561704cd46d2ac7767cf246183e70f13c7c45d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4265aadd3659a2c4dfbb58b772ada6c0862fa140348f359b86e7ce6aaac6578aa3268fabadd5c1d50300a6559fc1012ca1d7f108f9b63ae6be934000f42ba300
|
7
|
+
data.tar.gz: 5216b74fb5b9457b237c1d78203002f1a9a8621877d4fafb745ead05a40246e8acd2a061ad7d416e2aede51eb90183c6e3a4c75e055d242ab42a817c30be5682
|
@@ -4,13 +4,13 @@ require 'carrierwave'
|
|
4
4
|
class GoGamification::ImageUploader < CarrierWave::Uploader::Base
|
5
5
|
|
6
6
|
# Include MiniMagick support
|
7
|
-
include CarrierWave::MiniMagick
|
8
7
|
|
9
8
|
# Override the directory where uploaded files will be stored.
|
10
9
|
# This is a sensible default for uploaders that are meant to be mounted:
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
|
11
|
+
include CarrierWave::MiniMagick
|
12
|
+
include CarrierWave::RMagick
|
13
|
+
include Cloudinary::CarrierWave
|
14
14
|
|
15
15
|
# Provide a default URL as a default if there hasn't been a file uploaded:
|
16
16
|
# def default_url
|
@@ -32,6 +32,14 @@ class GoGamification::ImageUploader < CarrierWave::Uploader::Base
|
|
32
32
|
process :resize_to_fit => [150, 150]
|
33
33
|
end
|
34
34
|
|
35
|
+
version :icon64 do
|
36
|
+
process :resize_to_fit => [64, 64]
|
37
|
+
end
|
38
|
+
version :icon32 do
|
39
|
+
process :resize_to_fit => [32, 32]
|
40
|
+
end
|
41
|
+
|
42
|
+
|
35
43
|
# Add a white list of extensions which are allowed to be uploaded.
|
36
44
|
# For images you might use something like this:
|
37
45
|
# def extension_white_list
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<% if reward.medal %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
</div>
|
2
|
+
<div class="col-xs-6">
|
3
|
+
<div class="push-5"><%= image_tag reward.medal.image.icon32 %></div>
|
4
|
+
<div class="h5 font-w300 text-muted"><%= reward.medal.name %> - <%= reward.medal.description %></div>
|
5
|
+
</div>
|
7
6
|
<% end %>
|
8
7
|
|
9
8
|
<div class="points"><%= reward.points %></div>
|
9
|
+
|
@@ -1,10 +1,11 @@
|
|
1
1
|
class CreateGoGamificationScorings < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
3
|
create_table :go_gamification_scorings do |t|
|
4
|
-
t.references :task
|
5
|
-
t.references :subjectable, polymorphic: true
|
4
|
+
t.references :task,index: {:name => "index_game_scoring_on_tasks"}
|
5
|
+
t.references :subjectable, polymorphic: true,index: {:name => "index_game_scoring_on_subjectable"}
|
6
6
|
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
+
add_index :go_gamification_scorings, [:subjectable_id, :subjectable_type], name: 'index_go_game_score_on_subjectable'
|
9
10
|
end
|
10
11
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class RenameEverything < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
rename_table :go_gamification_scorings, :
|
3
|
+
rename_table :go_gamification_scorings, :go_gamification_rewards
|
4
4
|
rename_column :go_gamification_rewards, :subjectable_id, :rewardable_id
|
5
5
|
rename_column :go_gamification_rewards, :subjectable_type, :rewardable_type
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class RenameGoGamificationTasksToGoals < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
rename_table :go_gamification_tasks, :
|
3
|
+
rename_table :go_gamification_tasks, :go_gamification_goals
|
4
4
|
rename_column :go_gamification_rewards, :task_id, :goal_id
|
5
5
|
rename_column :go_gamification_medals, :task_id, :goal_id
|
6
6
|
end
|
@@ -1,8 +1,7 @@
|
|
1
|
-
require 'rails/all'
|
2
1
|
module GoGamification
|
3
2
|
class Engine < ::Rails::Engine
|
4
|
-
|
5
|
-
|
3
|
+
isolate_namespace GoGamification
|
4
|
+
initializer :append_migrations do |app|
|
6
5
|
# This prevents migrations from being loaded twice from the inside of the
|
7
6
|
# gem itself (dummy test app)
|
8
7
|
if app.root.to_s !~ /#{root}/
|
@@ -12,13 +11,21 @@ module GoGamification
|
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
initializer 'go_gamification.action_controller' do |app|
|
15
|
+
ActiveSupport.on_load :action_controller do
|
16
|
+
helper GoGamification::ApplicationHelper
|
17
|
+
end
|
18
|
+
end
|
20
19
|
|
20
|
+
initializer 'go_gamification.factories', after: 'factory_girl.set_factory_paths' do
|
21
|
+
FactoryGirl.definition_file_paths << File.expand_path('../../../spec/factories', __FILE__) if defined?(FactoryGirl)
|
22
|
+
end
|
21
23
|
|
24
|
+
config.generators do |g|
|
25
|
+
g.test_framework :rspec, fixture: false
|
26
|
+
g.fixture_replacement :factory_girl, dir: 'spec/factories'
|
27
|
+
g.assets false
|
28
|
+
g.helper false
|
29
|
+
end
|
22
30
|
end
|
23
|
-
|
24
|
-
end
|
31
|
+
end
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_gamification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- João Carlos Ottobboni
|
@@ -94,7 +94,7 @@ files:
|
|
94
94
|
- db/migrate/20171020182210_add_description_to_go_gamification_medals.rb
|
95
95
|
- db/migrate/20171020182248_rename_go_gamification_tasks_to_goals.rb
|
96
96
|
- db/migrate/20171020182329_add_seen_at_to_go_gamification_rewards.rb
|
97
|
-
- lib/
|
97
|
+
- lib/go_gamification.rb
|
98
98
|
- lib/go_gamification/activerecord.rb
|
99
99
|
- lib/go_gamification/checksum.rb
|
100
100
|
- lib/go_gamification/concerns.rb
|
@@ -108,7 +108,7 @@ files:
|
|
108
108
|
- lib/go_gamification/concerns/rewarding.rb
|
109
109
|
- lib/go_gamification/engine.rb
|
110
110
|
- lib/go_gamification/version.rb
|
111
|
-
- lib/tasks/
|
111
|
+
- lib/tasks/go_gamification_tasks.rake
|
112
112
|
homepage: http://www.gorails.com.br
|
113
113
|
licenses:
|
114
114
|
- MIT
|