added parameters for map function
This commit is contained in:
parent
3924575ac7
commit
d1539a7e0e
|
@ -106,8 +106,9 @@ 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)
|
def map(query, params = [])
|
||||||
conn.exec(query).map do |row|
|
# @sg-ignore
|
||||||
|
conn.exec(query, params).map do |row|
|
||||||
new(row, syncless: true)
|
new(row, syncless: true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "lpgar"
|
spec.name = "lpgar"
|
||||||
spec.version = "0.2.1"
|
spec.version = "0.2.2"
|
||||||
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