Skip to content

Fix update to decompose the key#15

Closed
trptcolin wants to merge 1 commit intomasterfrom
fix_update
Closed

Fix update to decompose the key#15
trptcolin wants to merge 1 commit intomasterfrom
fix_update

Conversation

@trptcolin
Copy link
Copy Markdown

I only saw 9 tests total for the whole SQL codebase, so I'm not sure whether there's another place I should be looking to add tests for this. Thoughts?

@mylesmegyesi
Copy link
Copy Markdown
Contributor

The SQL datastores are mostly tested through the high level shared datastore specs found here -- https://github.com/8thlight/hyperion/blob/master/api/src/hyperion/dev/spec.clj.

What was the reasoning for using decompose-key here instead of just taking the id?

@trptcolin
Copy link
Copy Markdown
Author

Maybe I'm missing something, but it didn't work. I don't have an id in my record at that point in the code.

@trptcolin
Copy link
Copy Markdown
Author

Sorry, more specifically than "didn't work", I got this kind of error:

java.lang.IllegalArgumentException: No implementation of method: :record<-db of protocol: #'hyperion.sql.format/FormattableForDatabase found for class: nil
        at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:527)
        at hyperion.sql.format$eval2408$fn__2431$G__2391__2444.invoke(format.clj:9)
        at hyperion.sql$save_record.invoke(sql.clj:33)
        at hyperion.sql.SQLDatastore$fn__2907.invoke(sql.clj:39)
        at clojure.core$map$fn__4087.invoke(core.clj:2432)
        at clojure.lang.LazySeq.sval(LazySeq.java:42)
        at clojure.lang.LazySeq.seq(LazySeq.java:60)
        at clojure.lang.RT.seq(RT.java:473)
        at clojure.core$seq.invoke(core.clj:133)
        at clojure.core$dorun.invoke(core.clj:2725)
        at clojure.core$doall.invoke(core.clj:2741)
        at hyperion.sql.SQLDatastore.ds_save(sql.clj:39)
        at hyperion.api$save.doInvoke(api.clj:251)
        at clojure.lang.RestFn.invoke(RestFn.java:423)
        at vushaper_web.videos.videos_controller$update_video.invoke(videos_controller.clj:102)
        at vushaper_web.videos.videos_controller$fn__4811$fn__4819.invoke(videos_controller.clj:112)
        at compojure.core$make_route$fn__1302.invoke(core.clj:93)

@slagyr
Copy link
Copy Markdown
Contributor

slagyr commented Nov 29, 2012

mylesmegyesi: "the problem was a little deeper than the solution in the pull request, so I had to fix it differently."

I'm closing the issue.

@slagyr slagyr closed this Nov 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants