Sha256: cf40a6fbaed2915f44332c6937d52629037d11a9b5262a9ade07c15e288a7aa4

Contents?: true

Size: 459 Bytes

Versions: 9

Compression:

Stored size: 459 Bytes

Contents

# encoding: utf-8
class WiceGridSerializedQuery < ActiveRecord::Base  #:nodoc:
  serialize :query

  validates_uniqueness_of :name, scope: :grid_name, on: :create, message: 'A query with this name already exists'

  validates_presence_of :name, message: 'Please submit the name of the custom query'

  # returns a list of all serialized queries
  def self.list(name, _controller)
    conditions = { grid_name: name }
    self.where(conditions).to_a
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
wice_grid_ms-3.6.2 lib/wice/wice_grid_serialized_query.rb
wice_grid_ms-3.6.1 lib/wice/wice_grid_serialized_query.rb
wice_grid_ms-3.6.0 lib/wice/wice_grid_serialized_query.rb
wice_grid-3.6.0 lib/wice/wice_grid_serialized_query.rb
wice_grid-3.6.0.pre5 lib/wice/wice_grid_serialized_query.rb
wice_grid-3.6.0.pre4 lib/wice/wice_grid_serialized_query.rb
wice_grid-3.6.0.pre3 lib/wice/wice_grid_serialized_query.rb
wice_grid-3.6.0.pre2 lib/wice/wice_grid_serialized_query.rb
wice_grid-3.6.0.pre1 lib/wice/wice_grid_serialized_query.rb