Sha256: 361bb0ee0cf286781c28751a63b7f00aa91859de71d3d5e9bb6164b8e56a71bc

Contents?: true

Size: 441 Bytes

Versions: 18

Compression:

Stored size: 441 Bytes

Contents

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

18 entries across 18 versions & 2 rubygems

Version Path
wice_grid-7.1.4 lib/wice/wice_grid_serialized_query.rb
wice_grid-7.1.3 lib/wice/wice_grid_serialized_query.rb
wice_grid-7.1.2 lib/wice/wice_grid_serialized_query.rb
wice_grid-7.1.1 lib/wice/wice_grid_serialized_query.rb
wice_grid-7.1.0 lib/wice/wice_grid_serialized_query.rb
wice_grid-6.1.3 lib/wice/wice_grid_serialized_query.rb
wice_grid-6.1.2 lib/wice/wice_grid_serialized_query.rb
wice_grid-6.1.1 lib/wice/wice_grid_serialized_query.rb
wice_grid-6.1.0 lib/wice/wice_grid_serialized_query.rb
pwice_grid-7.0.0 lib/wice/wice_grid_serialized_query.rb
pwice_grid-6.1.2 lib/wice/wice_grid_serialized_query.rb
pwice_grid-6.1.1 lib/wice/wice_grid_serialized_query.rb
pwice_grid-6.1.0 lib/wice/wice_grid_serialized_query.rb
pwice_grid-5.0.2 lib/wice/wice_grid_serialized_query.rb
pwice_grid-5.0.1 lib/wice/wice_grid_serialized_query.rb
pwice_grid-5.0.0 lib/wice/wice_grid_serialized_query.rb
wice_grid-4.1.0 lib/wice/wice_grid_serialized_query.rb
wice_grid-3.6.2 lib/wice/wice_grid_serialized_query.rb