Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 13:40
    shioyama synchronize #512
  • 13:40

    shioyama on original_column

    Add ColumnFallback plugin Add Sequel implementation of co… Fully support querying in colum… and 6 more (compare)

  • 13:37
    shioyama edited #529
  • 13:37
    shioyama closed #529
  • 13:37

    shioyama on master

    Add Sequel querying integration… Fix handling of Sequel::SQL::Ex… Expression -> ComplexExpression… (compare)

  • 13:31
    shioyama synchronize #529
  • 13:31

    shioyama on fix_sequel_querying

    Add Sequel querying integration… Fix handling of Sequel::SQL::Ex… Expression -> ComplexExpression… (compare)

  • 13:22
    shioyama edited #529
  • 13:21
    shioyama edited #529
  • 13:20
    shioyama opened #529
  • 13:20

    shioyama on fix_sequel_querying

    Add Sequel querying integration… Fix handling of Sequel::SQL::Ex… Expression -> ComplexExpression… (compare)

  • Sep 23 12:55

    shioyama on destroy_key_value_translations

    (compare)

  • Sep 23 12:55

    shioyama on configured_backend

    (compare)

  • Sep 23 12:54

    shioyama on 1-2

    Accept passing configured backe… Add inline docs mentioning opti… Extract defining after_destroy … and 8 more (compare)

  • Sep 23 12:54
    shioyama closed #528
  • Sep 23 12:54

    shioyama on master

    Accept passing configured backe… Add inline docs mentioning opti… Extract defining after_destroy … and 8 more (compare)

  • Sep 23 12:53
    shioyama commented #528
  • Sep 23 12:44
    shioyama synchronize #528
  • Sep 23 12:44

    shioyama on pass_configured_backend_to_setup

    Pass model class to backend cla… (compare)

  • Sep 23 12:39
    shioyama synchronize #528
Chris Salzberg
@shioyama
What exactly broke?
Bram Jetten
@Bramjetten
Yes 0.6.0 works as expected.
When saving pages, it says materialized_path is not unique.
Chris Salzberg
@shioyama
Can you point to the spec?
Bram Jetten
@Bramjetten
The materialized_path is generated in a before_validation callback and should always be unique since it will add "-2" otherwise
I'll look into it now and see if I can find the issue!
Chris Salzberg
@shioyama
Ok, do other specs pass with 0.7.0?
Bram Jetten
@Bramjetten
Yes, only errors are related to the materialized_path validation
Chris Salzberg
@shioyama
Ok, I'll have a look if you can point to the failing spec. Can you post an issue on Mobility?
Bram Jetten
@Bramjetten
I'm not getting a failing spec when running Mobility's tests
Bram Jetten
@Bramjetten
However, I'm seeing now that your spec says: is valid if no other record has same attribute value in same locale
While what I'm looking for is is valid if no other record has same attribute in *any* locale
I think it's better if I create my own uniqueness validator
Bram Jetten
@Bramjetten
Thinking about it some more, I think it's better to skip the uniqueness-validation altogether. It doesn't do anything meaningful.
Chris Salzberg
@shioyama
Hmm ok
About failing spec, I meant a failing spec in Spina
But also, is valid if no other record has same attribute in *any* locale would be more restrictive no? i.e. if a record is invalid if another record has the same materialized_path in any locale, then if should also be invalid if another record has the same value in the same locale, right? I must be misunderstanding.
Chris Salzberg
@shioyama
Actually, the spec description should really read "is valid if no other record has same attribute value in this locale"
In practice, you generally only change the current locale, so it's the same, but I'm wondering if the validator should maybe check changed attribute and apply the validator for every locale value that has changed...
Bram Jetten
@Bramjetten
You're right, it would make sense if the validation passed.
Chris Salzberg
@shioyama
Even if you decide to remove the validation, I'd like to know why it changed
Bram Jetten
@Bramjetten
We have a presence validation for :title
Bram Jetten
@Bramjetten
If I add uniqueness: true to that validation, it fails in the same way as materialized_path did
Chris Salzberg
@shioyama
ok
Sounds like a bug
Chris Salzberg
@shioyama
I ran the Spina specs and they passed with 0.7.0, was there a failing spec or did you just notice it wasn't working?
Bram Jetten
@Bramjetten
Did you use the master branch?
Because the master branch doesn't include the validation anymore
The 1.0 release should
Bram Jetten
@Bramjetten
I think I got it
Because of .unscoped it doesn't join the translations table anymore
Chris Salzberg
@shioyama
Yes I thought that might be the issue, but it shouldn't matter for the translations table
Anyway it's easy to check if that's the cause
Bram Jetten
@Bramjetten
If I remove unscoped, it passes the specs again
Chris Salzberg
@shioyama
Ah
Indeed, I see the same
I added unscoped because ActiveRecord does that
But I can easily remove it
Bram Jetten
@Bramjetten
Doesn't that cause issues with models with a default_scope?
Chris Salzberg
@shioyama
My understanding was that uniqueness should not depend on default_scope
But I should have looked deeper
anyway I'll yank that out and release 0.7.1
Thanks!
Bram Jetten
@Bramjetten
Awesome thanks!
I think I didn't look carefully enough
Chris Salzberg
@shioyama
Chris Salzberg
@shioyama
So, looking over the code, the question is really "why did Mobility specs not fail".