Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Include Other Solutions In README.md #1

Merged
merged 1 commit into from

2 participants

@metaskills

I added a section called Other Solution. It points to my project StoreConfigurable which is very similar. I too have just added the same section which points to yours too. See here.

https://github.com/metaskills/store_configurable
https://github.com/metaskills/store_configurable#other-solutions

@metaskills metaskills Include Other Solutions In README.md
I added a section called Other Solution. It points to my project StoreConfigurable which is very similar. I too have just added the same section which points to yours too. See here.

* https://github.com/metaskills/store_configurablehttps://github.com/metaskills/store_configurable#other-solutions
e03e9a5
@kenn
Owner

Serialized columns are always saved, even when it's not changed at all. So I chose not to support dirty tracking at all.

> u=User.first
> u.changed?
=> false
> u.save
  (0.3ms)  UPDATE `users` SET `updated_at` = '2012-09-22 06:07:12', `options` = '---\n:foo:\n :bar: 1\n' WHERE `users`.`id` = 1
=> true

What's your idea behind supporting dirty tracking?

@metaskills

Besides just generally being awesome? :smile:

StoreConfigurable is meant to be used by both the direct model and support namespaces (nested keys) for plugins, think WillPaginate, etc. This yields a cleaner interface when dealing with these potentially large config data sets. It also has the benefit of not sending potentially large strings back to the database when no work is needed. Big win in my book. I totally understand ActiveRecords choice as it would complicate things and require them to support what I have done too, which should not be their concern.

@kenn
Owner

It also has the benefit of not sending potentially large strings back to the database when no work is needed. Big win in my book.

What I'm saying is your proposition here is not true. Here's an example using store_configurable:

> u=User.first
> u.changed?
=> false
> u.save
  (0.3ms)  UPDATE "users" SET "_config" = '--- !omap []' WHERE "users"."id" = 1
=> true

See, the _config column is updated even though the user record is not changed at all. So I'm not seeing any point in tracking changes.

Am I missing anything here?

@metaskills

No, apparently I am, Thanks. I'm gonna do some work on StoreConfigurable to see what I can do about this, do you want to help?

What about this ticket? Did you not want to link share to common projects?

@kenn kenn merged commit 9a3ed70 into kenn:master
@kenn
Owner

Just merged, thanks for sharing your ideas!

I agree that dirty tracking would be a great win if that'd be ever possible. I just don't know how...

At least we should let our users know about this potential downside on performance, I guess.

@metaskills

Thanks, and agreed! I'll let you know what I find out too.

@kenn
Owner

Cool. That approach does seem like a good idea for your implementation, thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 21, 2012
  1. @metaskills

    Include Other Solutions In README.md

    metaskills authored
    I added a section called Other Solution. It points to my project StoreConfigurable which is very similar. I too have just added the same section which points to yours too. See here.
    
    * https://github.com/metaskills/store_configurablehttps://github.com/metaskills/store_configurable#other-solutions
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 README.md
View
5 README.md
@@ -139,3 +139,8 @@ YAML::ENGINE.yamler # => "psych"
```
If you are using Ruby 1.9.2 or later, `psych` should be used by default.
+
+## Other Solutions
+
+* [StoreConfigurable](https://github.com/metaskills/store_configurable) - A zero-configuration recursive Hash for storing a tree of options.
+
Something went wrong with that request. Please try again.