activerecord-fb-adapter 0.8.2 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,6 +76,10 @@ module ActiveRecord
76
76
  def column_types
77
77
  {}
78
78
  end
79
+
80
+ def columns
81
+ self.any? ? self.first.keys : []
82
+ end
79
83
  end
80
84
 
81
85
  class FbColumn < Column # :nodoc:
@@ -514,6 +518,10 @@ module ActiveRecord
514
518
  %Q("#{ar_to_fb_case(column_name.to_s)}")
515
519
  end
516
520
 
521
+ def quote_table_name_for_assignment(table, attr)
522
+ quote_column_name(attr)
523
+ end if ::ActiveRecord::VERSION::MAJOR >= 4
524
+
517
525
  # Quotes the table name. Defaults to column name quoting.
518
526
  # def quote_table_name(table_name)
519
527
  # quote_column_name(table_name)
@@ -713,15 +721,11 @@ module ActiveRecord
713
721
  # Returns an array of record hashes with the column names as keys and
714
722
  # column values as values.
715
723
  def select(sql, name = nil, binds = [])
716
- if binds.empty?
717
- translate(sql) do |sql, args|
718
- log(expand(sql, args), name) do
719
- @connection.query(:hash, sql, *args)
720
- end
724
+ translate(sql) do |sql, args|
725
+ unless binds.empty?
726
+ args = binds.map { |col, val| type_cast(val, col) } + args
721
727
  end
722
- else
723
- log(sql, name, binds) do
724
- args = binds.map { |col, val| type_cast(val, col) }
728
+ log(expand(sql, args), name) do
725
729
  @connection.query(:hash, sql, *args)
726
730
  end
727
731
  end
@@ -845,7 +849,7 @@ module ActiveRecord
845
849
  # change_column(:accounts, :description, :text)
846
850
  def change_column(table_name, column_name, type, options = {})
847
851
  sql = "ALTER TABLE #{quote_table_name(table_name)} ALTER COLUMN #{quote_column_name(column_name)} TYPE #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}"
848
- sql = add_column_options(sql, options)
852
+ add_column_options!(sql, options)
849
853
  execute(sql)
850
854
  end
851
855
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-fb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-03 00:00:00.000000000 Z
12
+ date: 2014-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fb
@@ -59,6 +59,5 @@ rubyforge_project:
59
59
  rubygems_version: 1.8.23
60
60
  signing_key:
61
61
  specification_version: 3
62
- summary: ActiveRecord Firebird Adapter for Rails 3 and 4. Unlike fb_adapter for Rails
63
- 1.x and 2.x, this version attempts to support migrations.
62
+ summary: ActiveRecord Firebird Adapter for Rails 3 and 4 with support for migrations.
64
63
  test_files: []