File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
lib/active_record/connection_adapters/sqlserver Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -735,14 +735,13 @@ def view_information(table_name)
735
735
view_info = select_one ( "SELECT * FROM #{ information_query_table } WITH (NOLOCK) WHERE TABLE_NAME = #{ quote ( identifier . object ) } " , "SCHEMA" )
736
736
737
737
if view_info
738
- view_info = view_info . to_h . with_indifferent_access # TODO: Fix so doesnt use hash.
739
- if view_info [ :VIEW_DEFINITION ] . blank? || view_info [ :VIEW_DEFINITION ] . length == 4000
740
- view_info [ :VIEW_DEFINITION ] = begin
741
- select_values ( "EXEC sp_helptext #{ identifier . object_quoted } " , "SCHEMA" ) . join
742
- rescue
743
- warn "No view definition found, possible permissions problem.\n Please run GRANT VIEW DEFINITION TO your_user;"
744
- nil
745
- end
738
+ if view_info [ 'VIEW_DEFINITION' ] . blank? || view_info [ 'VIEW_DEFINITION' ] . length == 4000
739
+ view_info [ 'VIEW_DEFINITION' ] = begin
740
+ select_values ( "EXEC sp_helptext #{ identifier . object_quoted } " , "SCHEMA" ) . join
741
+ rescue
742
+ warn "No view definition found, possible permissions problem.\n Please run GRANT VIEW DEFINITION TO your_user;"
743
+ nil
744
+ end
746
745
end
747
746
end
748
747
@@ -751,7 +750,7 @@ def view_information(table_name)
751
750
end
752
751
753
752
def views_real_column_name ( table_name , column_name )
754
- view_definition = view_information ( table_name ) [ : VIEW_DEFINITION]
753
+ view_definition = view_information ( table_name ) [ ' VIEW_DEFINITION' ]
755
754
return column_name unless view_definition
756
755
757
756
# Remove "CREATE VIEW ... AS SELECT ..." and then match the column name.
You can’t perform that action at this time.
0 commit comments