Metas without constant
-
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)?
-
Yurii Rashkovskii
- State changed from new to open
-
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):7I still doubt we should allow this way of meta definition — it complicates things, I think.
-
Yurii Rashkovskii
- State changed from open to resolved
(from [591e7fe8a219f16de2f3428dc01950a67c231e90]) Metas without constant initial implementation [#30 state:resolved]
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.