gemhome / rails-erd

retired fork, DO NOT USE. see https://github.com/voormedia/rails-erd
MIT License
0 stars 0 forks source link

no entities found #17

Open bf4 opened 10 years ago

bf4 commented 10 years ago

Issue by bf4 Thursday Jun 20, 2013 at 15:41 GMT Originally opened as https://github.com/voormedia/rails-erd/issues/56


just for documentation, the bug caused by the clickatell gem and fixed by removing it

also could work around it with this monkey patch

class RailsERD::Domain::Specialization
      DumbErd = Struct.new(:name) do
        def generalized?; false; end
      end
      def initialize(domain, generalized, specialized) # @private :nodoc:
        @domain = domain
        @generalized = generalized || DumbErd.new('unknown gen')
        @specialized = specialized  ||  DumbErd.new('unknown spe')
      end
end

also, fixed a bug for class with no table in an association (for whatever reason). Putting this here until I make a Pull Request

class RailsERD::Domain::Relationship
     def foreign_key_required?(association)
        if association.active_record.table_name && association.belongs_to?
          column = association.active_record.columns_hash[association.send(Domain.foreign_key_method_name)] and !column.null
        end
     end
end
bf4 commented 10 years ago

Comment by bf4 Wednesday Jul 24, 2013 at 21:49 GMT


See #55