Sha256: 9770674d0ad8d614964276a70f97f9d5b04df58c9d4e293ea89c7c90c7a20e1f

Contents?: true

Size: 734 Bytes

Versions: 22

Compression:

Stored size: 734 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    module Sqlserver
      class Utils
        
        class << self
          
          def unquote_string(string)
            string.to_s.gsub(/\'\'/, "'")
          end
          
          def unqualify_table_name(table_name)
            table_name.to_s.split('.').last.tr('[]','')
          end

          def unqualify_table_schema(table_name)
            table_name.to_s.split('.')[-2].gsub(/[\[\]]/,'') rescue nil
          end

          def unqualify_db_name(table_name)
            table_names = table_name.to_s.split('.')
            table_names.length == 3 ? table_names.first.tr('[]','') : nil
          end
          
        end
        
      end
    end
  end
end


Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
activerecord-sqlserver-adapter-3.2.18 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.17 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.16 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.15 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.14 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.13 lib/active_record/connection_adapters/sqlserver/utils.rb
sic-activerecord-sqlserver-adapter-4.0.0 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.12 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.11 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.10 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.9 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.8 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.7 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.6 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.5 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.4 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.3 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.2 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.1 lib/active_record/connection_adapters/sqlserver/utils.rb
activerecord-sqlserver-adapter-3.2.0 lib/active_record/connection_adapters/sqlserver/utils.rb