{"push_id":2052691135,"size":117,"distinct_size":117,"ref":"refs/heads/master","head":"1fc4c0f7761b9f8f856d8911461700a5e9c5b927","before":"b6df441f1ddbb627ecc8302fd2dab525a972827a","commits":[{"sha":"53dc2deb695cb46ce448bcda2b0cdf509c3e3e28","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Make notes default NULL in Observation fixture\n\nAfter the notes format is changed, and notes are serialized, both nil and \"\" notes will be persisted as NULL.\nTherefore current \"\" and nil notes will be up-migrated to NULL.\nBecause there will then be no way to tell them apart, they will both be NULL after down-migration. So then there's no way to tell them apart.\nSo we might as well make the default NULL to start with.","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/53dc2deb695cb46ce448bcda2b0cdf509c3e3e28"},{"sha":"f1645aa87110d6fde0978bc119e8a9a6b45333f5","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Write test of data migration to new notes format\n\nThis tests the migration in the test environment.\nUp migration:\n* `nil` => `nil`\n* `\"\"` => `nil`\n* `\"other\"` => `{ other: \"other\" }`\n\nDown\n* `nil` => `nil`\n* `{ other: \"other\" }`` => `\"other\"\n`","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/f1645aa87110d6fde0978bc119e8a9a6b45333f5"},{"sha":"462f8338c3fe788f64d2e932497656d9e05ef4d8","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Migrate Observation notes to new format\n\n- Write migration, migrate","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/462f8338c3fe788f64d2e932497656d9e05ef4d8"},{"sha":"f70da0df00b1de36c68c4b3c9fe0425279dbc072","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"`serialize` :notes\n\nThat's half the point of this branch.","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/f70da0df00b1de36c68c4b3c9fe0425279dbc072"},{"sha":"1306d02e6b1d1054623b3b514f254c88ac59475f","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Update Observation fixture file to new notes format","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/1306d02e6b1d1054623b3b514f254c88ac59475f"},{"sha":"b81344991b85f2d8c3df3bb0d45c1805b6d53032","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Fix some bugs in migration\n\nMigration wasn't doing what I thought because it was always serializing when writing.  Ditto for the tests.\n- Write directly to db when necessary\n- Add methods which escape a string for inclusion in a sql statement\n- Test more note strings","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/b81344991b85f2d8c3df3bb0d45c1805b6d53032"},{"sha":"020e5d27811af07f8ae6cb2ceceee43c9a4f1141","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Refactor migration (and test)\n\n- Especially batch migrate empty notes and nil notes, batch revert empty notes.  These not only speed things up, but also let  reversion succeed; otherwise it gives up in a random place in the middle.\n- Use Observation.connect instead of ActiveRecord:::Base.connection\n- refine method names\n- reorder methods","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/020e5d27811af07f8ae6cb2ceceee43c9a4f1141"},{"sha":"df2fbfbae1e70371613898fff70b07e8f2614e5a","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Migrate all notes to a hash\n\n- Migrate empty string and nil to serialized {}\n- Revert serialized {} to empty string\n- Use Observation.connection.quote instead of hand quoting and homemade quoting method.","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/df2fbfbae1e70371613898fff70b07e8f2614e5a"},{"sha":"324ef779b739ca1e704174fbe9ad632c9231125e","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Fix ObservationReport tests broken by new notes format\n\n- Add Observation methods formatting notes for export\n- Call new methods from ObservationReport","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/324ef779b739ca1e704174fbe9ad632c9231125e"},{"sha":"6fd120d2986f9a193263329d25c91357be871023","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Remove added textile markup from export formatted notes\n\nE.g., \"other: other notes\" rather than \"+other+: other notes\"","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/6fd120d2986f9a193263329d25c91357be871023"},{"sha":"098ffb3a480f82323031452c0ecc11d4ce264bbf","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Include notes formatted for export in ObservationChangeEmail\n\nFixes bug introduced by change in notes format. Observation.notes are now a Hash, rather than a String, so must convert to a String using `notes_export_formatted` and include that String in the email.","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/098ffb3a480f82323031452c0ecc11d4ce264bbf"},{"sha":"8732bc84020d9651d2b948a84e462d407b94b703","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Fix expectation in ObserverControllerTest#test_edit_observation\n\nMake it a hash, conforming to new notes format.\n\nThis fix exposes another bug, but that must await change to edit_observation.","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/8732bc84020d9651d2b948a84e462d407b94b703"},{"sha":"84275afdc611a88d67b013bde8a0afb77ee17466","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Conform expectations to updated notes export format\n\nI changed the format in #25d6a4a to remove markup, but neglected to update the test expectations.","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/84275afdc611a88d67b013bde8a0afb77ee17466"},{"sha":"40ec496603761df88df5ff14c1ac71a283a41142","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Fix pattern searches for has_notes: yes & no\n\n- Search for inequality/equality to serialized {}\n- Add convenience class methods to Observation","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/40ec496603761df88df5ff14c1ac71a283a41142"},{"sha":"58043310843f14370961b3cf299726eafdb84d30","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Use convenience method in Observation fixture\n\nBetter isolation of representation of no_notes","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/58043310843f14370961b3cf299726eafdb84d30"},{"sha":"e16b5470db024c1cc028e1754f4a48f80ff584e9","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Use Observation_notes instead of String literal\n\nIsolates no_notes from migration and pattern search.","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/e16b5470db024c1cc028e1754f4a48f80ff584e9"},{"sha":"962ecaf8f62e459490f67677865549820fbdc965","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Correctly save notes keys in create_observation\n\n- Whitelist notes hash\n- Convert notes hash keys to Symbols.  (Rails creates all parameter hash keys as Strings.)","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/962ecaf8f62e459490f67677865549820fbdc965"},{"sha":"25da94f379cf10dc9013716ac6e9e9e612fd645e","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Replace Rails query having optional param with Ruby method\n\nRails query which had fancy conditions was broken when used with serialized hash.  See following emails\n\n>me to Jason Jul 22\n...\n>\nA Rails query with an optional parameter returns different sql and results from the same query with a mandatory parameter, where the argument is an array of one hash.  With the optional parameter, the query returns the wrong results.\n>\n```ruby\n(byebug) p cond\n\"observations.notes != ?\"\n\"observations.notes != ?\"\n(byebug) vals\n[{:other=>\"test notes\"}]\n\n(byebug) spl.observations.where(cond, *vals)\n#<ActiveRecord::AssociationRelation [#<Observation id: 573429226, created_at: \"2005-05-12 17:20:00\", updated_at: \"2017-07-22 19:22:47\", when: \"2006-05-11\", user_id: 365790011, specimen: true, notes: {:other=>\"test notes\"}, thumb_image_id: nil, name_id: 271247339, location_id: 547147019, is_collection_location: false, vote_cache: 0.0, num_views: 0, last_view: nil, rss_log_id: nil, lat: #<BigDecimal:a0c8398,'0.123456E2',18(27)>, long: #<BigDecimal:a0c82a8,'-0.765432E2',18(27)>, where: nil, alt: 789>, #<Observation id: 1046914674, created_at: \"2006-05-12 17:20:00\", updated_at: \"2017-07-22 19:22:47\", when: \"2006-05-11\", user_id: 365790011, specimen: true, notes: {:other=>\"test notes\"}, thumb_image_id: 688136226, name_id: 271247339, location_id: 547147019, is_collection_location: false, vote_cache: 0.0, num_views: 0, last_view: nil, rss_log_id: 345853949, lat: #<BigDecimal:a0c2510,'0.123456E2',18(27)>, long: #<BigDecimal:a0c2420,'-0.765432E2',18(27)>, where: nil, alt: 789>]>\n\n(byebug) spl.observations.where(\"observations.notes != ?\", [{:other=>\"test notes\"}])\n#<ActiveRecord::AssociationRelation []>\n\n(byebug) spl.observations.where(cond, vals)\n#<ActiveRecord::AssociationRelation []>\n\n(byebug) spl.observations.where(cond, *vals).to_sql\n\"SELECT `observations`.* FROM `observations` INNER JOIN `observations_species_lists` ON `observations`.`id` = `observations_species_lists`.`observation_id` WHERE `observations_species_lists`.`species_list_id` = 75375684 AND (observations.notes != '---\\\\n- :other\\\\n- test notes\\\\n')\"\n\n(byebug) spl.observations.where(\"observations.notes != ?\", [{:other=>\"test notes\"}]).to_sql\n\"SELECT `observations`.* FROM `observations` INNER JOIN `observations_species_lists` ON `observations`.`id` = `observations_species_lists`.`observation_id` WHERE `observations_species_lists`.`species_list_id` = 75375684 AND (observations.notes != '---\\\\n:other: test notes\\\\n')\"\n\n(byebug) spl.observations.where(cond, vals).to_sql\n\"SELECT `observations`.* FROM `observations` INNER JOIN `observations_species_lists` ON `observations`.`id` = `observations_species_lists`.`observation_id` WHERE `observations_species_lists`.`species_list_id` = 75375684 AND (observations.notes != '---\\\\n:other: test notes\\\\n')\"\n```\n(This is from SpeciesListController, lines 1080-1082.)\n\n>Jason Hollinger to me Jul 22\nAfter spending way too long just trying to see what was different between these three runs(!), I have to suggest that this is just not the right way to do this.  How about avoiding altogether testing directly the string that rails uses to store the serialized notes hash.  Instead do something like:\n>\nspl.observations.where(\"observations.notes like '%test notes%'\")\n>\nor whatever the correct syntax is.  No matter how it serializes the notes, this string must be present!  If that's too lax, just return all the observations and do the filter in ruby:\n>\nspl.observations.select {|o| o.notes == {other: \"test notes\"}}\n>\nRails clearly cannot be trusted to do fancy conditions involving serialized hashes.  So avoid that altogether and do it more transparently.\n>\nAnyway.  That's my suggestion.  There are, of course, 100 other ways of approaching and solving this problem!","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/25da94f379cf10dc9013716ac6e9e9e612fd645e"},{"sha":"0f9787f86af8f2a15440bcd43d3fc5ac3efb1d38","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Fix SpeciesListController bug created by new notes format\n\nNote: **This is partly a Shameless Green fix. The textarea and expectation for notes will need to be fixed after I get Observation notes display correct.**","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/0f9787f86af8f2a15440bcd43d3fc5ac3efb1d38"},{"sha":"15720ce1df7b9abba4589fce44be98343f5c83ed","author":{"name":"Joe Cohen","email":"4d8ade18d49694b2d59ea94fefdaa4c49b5eaf86@gmail.com"},"message":"Fix expectation in ObserverControllerTest#test_edit_observation_bad_place_name\n\nConform to new notes format","distinct":true,"url":"https://api.github.com/repos/JoeCohen/mushroom-observer/commits/15720ce1df7b9abba4589fce44be98343f5c83ed"}]}
{"actor":{"display_login":"JoeCohen"}}