Created
March 1, 2012 00:14
-
-
Save alexeckermann/1945951 to your computer and use it in GitHub Desktop.
How can this be done without calling a private method?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/registration.rb | |
class Registration | |
attr_accessor :current_step | |
end | |
# Registration then ONLY has :current_step in it and the other methods from the engine are blasted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/extensions.rb | |
# --- | |
# Registration is defined as a model in an engine. | |
# On the local app I want to add :current_step as an attr so I can use it in the interface. | |
# Without adding it to the engine model how can I extend the class without resorting to calling include like this. | |
# Ideally id love to put this into app/models/registration.rb but "X file expects to define class Y" is a bitch. | |
module Extension | |
module Registration | |
attr_accessor :current_step | |
end | |
end | |
Registration.send(:include, Extension::Registration) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment