Class: RDFMapper::Adapters::Rails::Query
- Inherits:
-
Object
- Object
- RDFMapper::Adapters::Rails::Query
- Includes:
- Logger
- Defined in:
- lib/lib/adapters/rails.rb
Defined Under Namespace
Classes: SQL
Instance Method Summary collapse
-
#create ⇒ Object
[-].
-
#find ⇒ Object
[-].
-
#initialize(query, options = {}) ⇒ Query
constructor
A new instance of Query.
-
#update ⇒ Object
[-].
Methods included from Logger
Constructor Details
#initialize(query, options = {}) ⇒ Query
Returns a new instance of Query.
87 88 89 90 91 |
# File 'lib/lib/adapters/rails.rb', line 87 def initialize(query, = {}) @query, @options = query, @rails = (@options[:class_name] || @query.cls.to_s.demodulize).constantize setup_replacements end |
Instance Method Details
#create ⇒ Object
- -
104 105 106 107 |
# File 'lib/lib/adapters/rails.rb', line 104 def create record = @rails.create() record_attributes(record) end |
#find ⇒ Object
- -
112 113 114 115 116 117 118 119 120 121 |
# File 'lib/lib/adapters/rails.rb', line 112 def find @query.check(:rails_id) # #debug 'Searching for %s with %s' % [@rails, @query.inspect] #debug 'Query: %s' % find_options.inspect # @rails.find(:all, ).map do |record| record_attributes(record) end end |
#update ⇒ Object
- -
96 97 98 99 |
# File 'lib/lib/adapters/rails.rb', line 96 def update record = @rails.update(@query[:rails_id], ) record_attributes(record) end |