lib/github/sql.rb in github-ds-0.4.0 vs lib/github/sql.rb in github-ds-0.5.0

- old
+ new

@@ -41,11 +41,11 @@ # Public: Run inside a transaction. Class version of this method only works # if only one connection is in use. If passing connections to # GitHub::SQL#initialize or overriding connection then you'll need to use # the instance version. def self.transaction(options = {}, &block) - ActiveRecord::Base.connection.transaction(options, &block) + ActiveRecord::Base.connection.transaction(**options, &block) end # Public: Instantiate a literal SQL value. # # WARNING: The given value is LITERALLY inserted into your SQL without being @@ -211,11 +211,11 @@ return [] if frozen? # Use select_all to retrieve hashes for each row instead of arrays of values. @models = connection. select_all(query, "#{klass.name} Load via #{self.class.name}"). - collect! { |record| klass.send :instantiate, record } + map { |record| klass.send :instantiate, record } retrieve_found_row_count freeze @models @@ -297,10 +297,10 @@ results.map(&:first) end # Public: Run inside a transaction for the connection. def transaction(options = {}, &block) - connection.transaction(options, &block) + connection.transaction(**options, &block) end # Internal: The object we use to execute SQL and retrieve results. Defaults # to AR::B.connection, but can be overridden with a ":connection" key when # initializing a new instance.