Skip to content

Commit

Permalink
Merge pull request #230 from ifad/chore/use-quoted-table-name
Browse files Browse the repository at this point in the history
Use quoted table name
  • Loading branch information
tagliala authored Sep 22, 2023
2 parents dfddf74 + 3daf3db commit 7362608
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions benchmarks/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
ITERATIONS.times { first_foo.as_of(Time.now) }
end

x.report('#timeline') do
ITERATIONS.times { first_foo.timeline }
end

x.report('TimeGate .merge') do
ITERATIONS.times { Bar.merge(Bar.all) }
end
Expand Down
2 changes: 1 addition & 1 deletion lib/chrono_model/time_machine/timeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def timeline_associations_from(names)

def quoted_history_fields
@quoted_history_fields ||= begin
validity = "#{connection.quote_table_name(table_name)}.#{connection.quote_column_name('validity')}"
validity = "#{quoted_table_name}.#{connection.quote_column_name('validity')}"

%w[lower upper].map! { |func| "#{func}(#{validity})" }
end
Expand Down

0 comments on commit 7362608

Please sign in to comment.