Module: ActiveRecordToSimpledb::Query
- Defined in:
- lib/active_record_to_simpledb.rb
Class Method Summary collapse
-
.find(domain, id) ⇒ Object
Public: It finds a Simpledb record given the domain and record id.
-
.find_by_sql(query) ⇒ Object
Public: It finds a Simpledb record using a sqlish query array / string - A SQLish array with the query.
Class Method Details
.find(domain, id) ⇒ Object
Public: It finds a Simpledb record given the domain and record id
string - the name of the domain to query integer - the id of the record in ActiveRecord
74 75 76 |
# File 'lib/active_record_to_simpledb.rb', line 74 def self.find(domain, id) ActiveRecordToSimpledb.aws_connect.get_attributes(domain, id) end |
.find_by_sql(query) ⇒ Object
Public: It finds a Simpledb record using a sqlish query array / string - A SQLish array with the query
Example:
query = [“select * from ticket_sales where event_id=?”, ‘123’] ActiveRecordToSimpledb::Query.find_by_sql( query )
87 88 89 |
# File 'lib/active_record_to_simpledb.rb', line 87 def self.find_by_sql(query) ActiveRecordToSimpledb.aws_connect.select(query) end |