From 2c72ee65bffc491f9225c5331535132f18f3a400 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 12 Nov 2015 09:07:59 -0300 Subject: [PATCH] Small fixes for rails4 --- models/gamification_plugin/points_categorization.rb | 4 ++-- models/gamification_plugin/points_type.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/gamification_plugin/points_categorization.rb b/models/gamification_plugin/points_categorization.rb index 275ef30..0e69209 100644 --- a/models/gamification_plugin/points_categorization.rb +++ b/models/gamification_plugin/points_categorization.rb @@ -1,4 +1,4 @@ -class GamificationPlugin::PointsCategorization < Noosfero::Plugin::ActiveRecord +class GamificationPlugin::PointsCategorization < ActiveRecord::Base belongs_to :profile belongs_to :point_type, class_name: 'GamificationPlugin::PointsType', foreign_key: :point_type_id attr_accessible :profile_id, :profile, :point_type_id, :weight @@ -10,5 +10,5 @@ class GamificationPlugin::PointsCategorization < Noosfero::Plugin::ActiveRecord scope :for_type, lambda { |p_type| joins(:point_type).where(gamification_plugin_points_types: {name: p_type}) } scope :for_profile, lambda { |p_profile| joins(:profile).where(profiles: {identifier: p_profile}) } - scope :grouped_profiles, select(:profile_id).group(:profile_id).includes(:profile) + scope :grouped_profiles, -> { select(:profile_id).group(:profile_id).includes(:profile) } end diff --git a/models/gamification_plugin/points_type.rb b/models/gamification_plugin/points_type.rb index ad5a1d7..a97218a 100644 --- a/models/gamification_plugin/points_type.rb +++ b/models/gamification_plugin/points_type.rb @@ -1,4 +1,4 @@ -class GamificationPlugin::PointsType < Noosfero::Plugin::ActiveRecord +class GamificationPlugin::PointsType < ActiveRecord::Base attr_accessible :description, :name validates :name, presence: true, uniqueness: true -- libgit2 0.21.2