Method: ActiveRecord::Relation#to_sql
- Defined in:
- lib/ocean-dynamo/active_record_stuff/relation.rb
#to_sql ⇒ Object
Returns sql statement for the relation.
User.where(name: 'Oscar').to_sql
# => SELECT "users".* FROM "users" WHERE "users"."name" = 'Oscar'
491 492 493 |
# File 'lib/ocean-dynamo/active_record_stuff/relation.rb', line 491 def to_sql @to_sql ||= klass.connection.to_sql(arel, bind_values.dup) end |