go_gamification 0.0.4 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3fb86cf728e56675260225b07d108a17f89e3a85
4
- data.tar.gz: 8d03d03b15e0fd901dd9255595b035df475c6ae5
3
+ metadata.gz: 2652a99ab1f5d6d960aee80377811d06a19d44ae
4
+ data.tar.gz: 04561704cd46d2ac7767cf246183e70f13c7c45d
5
5
  SHA512:
6
- metadata.gz: cdd7f6db325a7d18d0ebce1e116821f8da48d7b3d4c4d701cd3b7be79eb94c1f42a47b188a8c46147cd884dfa9aa3c4ddf182485a63bfc22fe34bc1d9ca96f03
7
- data.tar.gz: a1076d5420f09ff672cfa0e5b13d21723e809454b9f662dd3ec0b4a9a7ff95367bbe2943262463a8e2d3f0b606b4f1a03703349b34e4bc6aae08a7a79abc3950
6
+ metadata.gz: 4265aadd3659a2c4dfbb58b772ada6c0862fa140348f359b86e7ce6aaac6578aa3268fabadd5c1d50300a6559fc1012ca1d7f108f9b63ae6be934000f42ba300
7
+ data.tar.gz: 5216b74fb5b9457b237c1d78203002f1a9a8621877d4fafb745ead05a40246e8acd2a061ad7d416e2aede51eb90183c6e3a4c75e055d242ab42a817c30be5682
@@ -1,6 +1,7 @@
1
1
  module GoGamification
2
2
  module ApplicationHelper
3
3
 
4
+
4
5
  # Create a form to reward someone for something.
5
6
  #
6
7
  # rewardable - A model that is rewardable (e.g. a user)
@@ -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
- def store_dir
12
- "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
13
- end
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,7 +1,12 @@
1
1
  <% if rewards.any? %>
2
2
  <div class="reward-presentation">
3
+ <div class="block-content">
4
+ <div class="row items-push text-center">
3
5
  <% rewards.each do |reward| %>
4
6
  <%= render reward %>
5
7
  <% end %>
8
+ </div>
9
+ </div>
6
10
  </div>
7
11
  <% end %>
12
+
@@ -1,9 +1,9 @@
1
1
  <% if reward.medal %>
2
- <div class="medal">
3
- <div class="image"><%= image_tag reward.medal.image %></div>
4
- <div class="name"><%= reward.medal.name %></div>
5
- <div class="description"><%= reward.medal.description %></div>
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, :gamification_rewards
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, :gamification_goals
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
- initializer :append_migrations do |app|
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
- config.i18n.default_locale = :'pt-BR'
16
- config.autoload_paths += %W(#{config.root}/lib)
17
- config.time_zone = 'Brasilia'
18
- config.i18n.load_path += Dir[config.root.join('config', 'locales','**', '*.{rb,yml}').to_s]
19
- config.encoding = "utf-8"
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
@@ -1,3 +1,3 @@
1
1
  module GoGamification
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
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
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/go_gamefication.rb
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/go_gamefication_tasks.rake
111
+ - lib/tasks/go_gamification_tasks.rake
112
112
  homepage: http://www.gorails.com.br
113
113
  licenses:
114
114
  - MIT