diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-04-26 23:51:10 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-04-26 23:51:10 +0000 |
commit | d0d01d4e704b0d15dfd3ce2d5213ab8b5a6678fb (patch) | |
tree | 31a2f938e01ae8032d0e4c19d979f7df575d332e /app/models/version.rb | |
parent | 71649ba2f137f3a48af031193af2b7f315519299 (diff) | |
download | redmine-d0d01d4e704b0d15dfd3ce2d5213ab8b5a6678fb.tar.gz redmine-d0d01d4e704b0d15dfd3ce2d5213ab8b5a6678fb.zip |
model: replace Rails2 "named_scope" to Rails3 "scope"
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9537 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/version.rb')
-rw-r--r-- | app/models/version.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/version.rb b/app/models/version.rb index 24be5df02..fb97fa076 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -34,9 +34,9 @@ class Version < ActiveRecord::Base validates_inclusion_of :status, :in => VERSION_STATUSES validates_inclusion_of :sharing, :in => VERSION_SHARINGS - named_scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}} - named_scope :open, :conditions => {:status => 'open'} - named_scope :visible, lambda {|*args| { :include => :project, + scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}} + scope :open, :conditions => {:status => 'open'} + scope :visible, lambda {|*args| { :include => :project, :conditions => Project.allowed_to_condition(args.first || User.current, :view_issues) } } safe_attributes 'name', |