Compare commits
No commits in common. "c5f6a11a8d0bc9c7151f8a71a7279543d76b8251" and "3924575ac723a149bfa0018d1d9a676e5d18175f" have entirely different histories.
c5f6a11a8d
...
3924575ac7
|
@ -106,9 +106,8 @@ module LPGAR
|
||||||
# Map returned rows from a query to an array of objects of this table.
|
# Map returned rows from a query to an array of objects of this table.
|
||||||
# @param query [String] raw postgresql query
|
# @param query [String] raw postgresql query
|
||||||
# @return [Array(Object)] array of records of this table
|
# @return [Array(Object)] array of records of this table
|
||||||
def map(query, params = [])
|
def map(query)
|
||||||
# @sg-ignore
|
conn.exec(query).map do |row|
|
||||||
conn.exec(query, params).map do |row|
|
|
||||||
new(row, syncless: true)
|
new(row, syncless: true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -135,6 +134,7 @@ module LPGAR
|
||||||
WHERE #{selector}
|
WHERE #{selector}
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
QUERY
|
QUERY
|
||||||
|
puts @sync_query
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns transaction class for this record.
|
# Returns transaction class for this record.
|
||||||
|
@ -357,7 +357,6 @@ module LPGAR
|
||||||
# Create class from table name
|
# Create class from table name
|
||||||
# @param name [String]
|
# @param name [String]
|
||||||
# @param block [#call]
|
# @param block [#call]
|
||||||
# @return [Class]
|
|
||||||
def table(name, &block)
|
def table(name, &block)
|
||||||
conn = @conn
|
conn = @conn
|
||||||
new_class = Class.new(Record) do
|
new_class = Class.new(Record) do
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "lpgar"
|
spec.name = "lpgar"
|
||||||
spec.version = "0.2.4"
|
spec.version = "0.2.1"
|
||||||
spec.summary = "Lightweight Postgres Active Record"
|
spec.summary = "Lightweight Postgres Active Record"
|
||||||
spec.description = <<~DESC
|
spec.description = <<~DESC
|
||||||
Lightweight implementation of Active Record pattern for Postgres.
|
Lightweight implementation of Active Record pattern for Postgres.
|
||||||
|
|
Loading…
Reference in New Issue