Enforce associations (and may be coercion/validation) definitions
-
Yurii Rashkovskii
Uhmm...
StrokeDB 0.0.2.1 (help! for more info) clear! # ==> "Database has been wiped out." User = Meta.new { has_many :items } # ==> User Item = Meta.new # ==> Item User.document # ==> #<Meta has_many_items: #<View conditions: nil, expected_meta: "Item", expected_nsurl: "", extend_with: nil, key_size: nil, nsurl: "http://strokedb.com/", reference_slotname: "user", reverse: false, sort_by: nil, strategy: "heads", through: [], uuid: "e628595d-326c-5dff-a578-575662606d67", value_size: 16, version: 0000...>, name: "User", nsurl: "", uuid: "85631643-fe29-596a-9670-8765d39463bf", version: 0000...> u = User.create :a => 1 NoMethodError: undefined method `create' for User:Module from (irb):5 u = User.create! :a => 1 # ==> #<User a: 1, uuid: "af1ddd12-6d74-4966-804c-a8c03d8c588d", version: 0000...> i = Item.create! :user => u # ==> #<Item user: #<User a: 1, uuid: "af1ddd12-6d74-4966-804c-a8c03d8c588d", version: 0000...>, uuid: "3784fe21-e019-4df9-ada6-03e244f96cec", version: 0000...> u.items # ==> [#<Item user: #<User a: 1, uuid: "af1ddd12-6d74-4966-804c-a8c03d8c588d", version: 0000...>, uuid: "3784fe21-e019-4df9-ada6-03e244f96cec", version: 0000...>] quit imac:strokedb(new-views) $ sc StrokeDB 0.0.2.1 (help! for more info) User = Meta.new { has_many :items } # ==> User Item = Meta.new # ==> Item User.document NoMethodError: undefined method `head_version' for nil:NilClass -
Yurii Rashkovskii
- State changed from new to resolved
we had major serialization problems in storage... preliminary fix has been developed (though we still need to refactor serialization)
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.