4 ms·
Where would one find out if anyone is working on a patch for ActiveRecord?
by btown 14y ago
Where would one find out if anyone is working on a patch for ActiveRecord?
- masklinn 14y agoThe Rails/ActiveRecord bug tracker? edit: the underlying connector might be a better idea to start with, as it'll need to expose the fields somehow before an ORM can take advantage of them.
- judofyr 14y agohttps://bitbucket.org/ged/ruby-pg https://bitbucket.org/ged/ruby-pg
- jeltz 14y agoI think it can use either pg (wrapper around libpq) or postgres-pr (pure ruby), though I always use pg. EDIT: Seems like they have dropped support for postgres. EDIT2: Yes, I did mean postgres-pr.
- masklinn 14y agoDo you mean postgres-pr? (postgres is marked as a deprecated gem to replace with pg)
- netghost 14y agoThis is where you'd want to be looking in the source: https://github.com/rails/rails/tree/master/activerecord/lib/active_record/connection_adapters/postgresql https://github.com/rails/rails/tree/master/activerecord/lib/... Specifically at any error handling, which I think would likely be here: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb https://github.com/rails/rails/blob/master/activerecord/lib/...
- joevandyk 14y agoLooks like work has started on the underlying connector: https://bitbucket.org/ged/ruby-pg/issue/161/add-support-for-pg_diag_-_name-error https://bitbucket.org/ged/ruby-pg/issue/161/add-support-for-...
- masklinn 14y agoI wouldn't say "work has started" when the bug has just been reported.
- effn 14y agoActiveRecord doesn't even support constraints in the first place.
- joevandyk 14y agoWhat do you mean by "support constraints"? If I, for example, violate a unique index, a ActiveRecord::RecordNotUnique exception is raised.
- mjhoy 14y agoIs that true? I might be wrong about this, but I think ActiveRecord checks for uniqueness (and other constraints) in application code, generating an extra database query if needed. If you _actually_ violate the unique index, a PGError is raised (if using postgres).
- FooBarWidget 14y agoNo. ActiveRecord checks for constraints on top of what the database offers. You are free to specify database constraints if you like. In older versions of ActiveRecord, uniqueness errors generate a generic database exception. In recent versions, uniqueness errors generate the specific exception RecordNotUnique.
- pjungwir 14y agoShameless plug: here is a gem I wrote to manage foreign keys and CHECK constraints (and also indexes) in a Rails project: https://github.com/pjungwir/db_leftovers https://github.com/pjungwir/db_leftovers
- moonlight80 14y agoI think ActiveRecord pattern is more limiting you than helpful. I found the following post quite interesting: http://mindref.blogspot.com/2013/02/sql-vs-orm.html http://mindref.blogspot.com/2013/02/sql-vs-orm.html