Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Metas without constant

#30

Meta.new :name=>"SomeName" should not produce a SomeName constant.

With current implementation based on UUIDv5 it might be easy to fix.

Reported by Oleg Andreev · April 29th, 2008 @ 09:12 PM

State: resolved
Milestone: 0.0.3
Assigned to: Yurii Rashkovskii Yurii Rashkovskii

Activity

  1. Yurii Rashkovskii
    Yurii Rashkovskii

    That will mean that I will not be able to lookup meta definition block (unless I will cache it per meta). Should I cache it (like I do for views)?

    April 29th, 2008 @ 09:30 PM

  2. Yurii Rashkovskii
    Yurii Rashkovskii
    • State changed from new to open

    April 30th, 2008 @ 04:10 AM

  3. Yurii Rashkovskii
    Yurii Rashkovskii

    While I do not like those metas without constants, I managed to get it working (though with implication of some code spots, so we'll need more refactoring):

    Meta.new(:name => "User", :nsurl => 'a') { def ping; 'pong' ; end }
        # ==> User
    usermeta = _
        # ==> User
    u = usermeta.create! :a => "1"
        # ==> #<User a: "1", uuid: "64b1b028-4e9b-47d1-aa95-616f77756d06", version: 0000...>
    u.ping
        # ==> "pong"
    u.reload.ping
        # ==> "pong"
    User
    NameError: uninitialized constant User
    	from (irb):7
    

    I still doubt we should allow this way of meta definition — it complicates things, I think.

    April 30th, 2008 @ 05:19 AM

  4. Yurii Rashkovskii
    Yurii Rashkovskii
    • State changed from open to resolved

    (from [591e7fe8a219f16de2f3428dc01950a67c231e90]) Metas without constant initial implementation [#30 state:resolved]

    http://github.com/yrashk/stroked...

    April 30th, 2008 @ 05:20 AM

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.