Revision feacea35
Added by Amos Benari about 11 years ago
- ID feacea35f07f362d9e2c694a83516bbc902321a0
app/models/bookmark.rb | ||
---|---|---|
validates_uniqueness_of :name, :unless => Proc.new{|b| Bookmark.my_bookmarks.where(:name => b.name).empty?}
|
||
validates_presence_of :name, :controller, :query
|
||
validates_format_of :controller, :with => /\A(\S+)\Z/, :message => "can't be blank or contain white spaces."
|
||
default_scope :order => :name
|
||
default_scope lambda { order(:name) }
|
||
before_validation :set_default_user
|
||
|
||
scope :my_bookmarks, lambda {
|
||
... | ... | |
{:conditions => conditions}
|
||
}
|
||
|
||
scope :controller, lambda{|*args| {:conditions => ["controller = ?", (args.first || '')]}}
|
||
scope :controller, lambda { |*args| where("controller = ?", (args.first || '')) }
|
||
|
||
def set_default_user
|
||
self.owner ||= User.current
|
Also available in: Unified diff
upgrade foreman to rails 3.2.13
This commit updates from rails 3.0.x to 3.2.x, main changes include:
Users who uses foreman in production, make sure that you now compile
your assets, e.g
rake assets:precompile
Paired-with: Joseph Mitchell Magen <jmagen@redhat.com>
Paired-with: Ohad Levy <ohadlevy@gmail.com>
Signed-off-by: Ohad Levy <ohadlevy@gmail.com>