You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to blueprints
I'm removing Class.blueprint and instance.blueprint extensions.
Instead going for this syntax (I'm not sure if type and instance are
the best keywords here):
type(User).blueprint :admin...
type(Project) do
blueprint :project1
blueprint :project2 do
instance.find(12) # Project.find(12)
end
end
I'm also planning to change how extensions are defined by allowing
them to be defined in blueprints files. It will look something like
this:
extend ActiveRecord::Base do
# Build with default strategy
default do
instance.create!(attributes, :without_protection => true)
end
# Build with update strategy
update do
instance.update_attributes!(attributes, :without_protection =>
true)
end
end
require 'blueprints/extensions/mongoid' # or use extensions from
blueprints itself
Also this is very experimental, but I think I'll add some more
syntatic sugar with method missing to allow defining blueprints
without blueprint method:
type(User).admin :username => 'admin' # translates to
type(User).blueprint :admin...