Sha256: a2fea190d9c79c1edd2186943f645cd9da88ea85ace41d6d8460d54f3b543189
Contents?: true
Size: 1001 Bytes
Versions: 17
Compression:
Stored size: 1001 Bytes
Contents
module SchemaPlus::ForeignKeys module ActiveRecord # # SchemaPlus::ForeignKeys adds several methods to ActiveRecord::Base # module Base module ClassMethods #:nodoc: public # Returns a list of ForeignKeyDefinition objects, for each foreign # key constraint defined in this model's table # # (memoized result gets reset in Middleware::Model::ResetColumnInformation) def foreign_keys @foreign_keys ||= connection.foreign_keys(table_name, "#{name} Foreign Keys") end def reset_foreign_key_information @foreign_keys = @reverse_foreign_keys = nil end # Returns a list of ForeignKeyDefinition objects, for each foreign # key constraint of other tables that refer to this model's table def reverse_foreign_keys @reverse_foreign_keys ||= connection.reverse_foreign_keys(table_name, "#{name} Reverse Foreign Keys") end end end end end
Version data entries
17 entries across 17 versions & 2 rubygems