Merge Request #207
← To merge requests
From
fix_license_autocomplete
into
master
Fixes license_info autocomplete on Software creation
Correção no escopo do license_info para compatibilidade com Rails 3
Closes #767
Commits (1)
-
Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
2 changed files
Show diff stats
src/noosfero-spb/software_communities/lib/license_helper.rb
@@ -5,7 +5,7 @@ module LicenseHelper | @@ -5,7 +5,7 @@ module LicenseHelper | ||
5 | end | 5 | end |
6 | 6 | ||
7 | def self.all | 7 | def self.all |
8 | - licenses = LicenseInfo.all.without_another.select("id, version") | 8 | + licenses = LicenseInfo.without_another.select("id, version") |
9 | put_another_at_the_end licenses | 9 | put_another_at_the_end licenses |
10 | end | 10 | end |
11 | 11 |
src/noosfero-spb/software_communities/lib/license_info.rb
@@ -5,5 +5,5 @@ class LicenseInfo < ActiveRecord::Base | @@ -5,5 +5,5 @@ class LicenseInfo < ActiveRecord::Base | ||
5 | 5 | ||
6 | has_many :software_info | 6 | has_many :software_info |
7 | 7 | ||
8 | - scope :without_another, -> { where.not(version: 'Another') } | 8 | + scope :without_another, lambda { where("version != 'Another'") } |
9 | end | 9 | end |
-
mentioned in commit 8dc50f2cb5d1ff3b96596c16c6ad97c7f5788a49