Module: PlainQuery
- Defined in:
- lib/plain_query.rb,
lib/plain_query/builder.rb,
lib/plain_query/version.rb,
lib/plain_query/class_methods.rb,
lib/plain_query/builder_options.rb,
lib/plain_query/instance_methods.rb
Defined Under Namespace
Modules: Base, ClassMethods, InstanceMethods Classes: Builder, BuilderOptions
Constant Summary collapse
- VERSION =
'0.2.1'.freeze
Class Method Summary collapse
-
.Base(model: nil) ⇒ Object
This method allows to declare model parameter associated with this query object.
Class Method Details
.Base(model: nil) ⇒ Object
This method allows to declare model parameter associated with this query object. Model parameter is useful for model scopes building Example: class UsersQuery
include PlainQuery::Base(model: User)
...
end class User < ActiveRecord::Base
scope :available, UsersQuery
end
28 29 30 |
# File 'lib/plain_query.rb', line 28 def self.Base(model: nil) PlainQuery::Builder.new(model: model) end |