Class: Susply::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Susply::InstallGenerator
- Defined in:
- lib/generators/susply/install_generator.rb
Instance Method Summary collapse
- #billable_entity ⇒ Object
- #copy_locales ⇒ Object
- #install ⇒ Object
- #subscription_owner_model ⇒ Object
Instance Method Details
#billable_entity ⇒ Object
12 13 14 |
# File 'lib/generators/susply/install_generator.rb', line 12 def billable_entity @subscription_owner_model.downcase end |
#copy_locales ⇒ Object
26 27 28 29 |
# File 'lib/generators/susply/install_generator.rb', line 26 def copy_locales copy_file "../../../config/locales/susply.en.yml", "config/locales/susply.en.yml" end |
#install ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/generators/susply/install_generator.rb', line 16 def install template "config/initializers/susply.rb" inject_into_class "app/models/#{subscription_owner_model.downcase}.rb", subscription_owner_model.downcase.camelize.constantize, "# Added by Susply\n include Susply::OwnerMethods \n\n" copy_locales end |
#subscription_owner_model ⇒ Object
8 9 10 |
# File 'lib/generators/susply/install_generator.rb', line 8 def subscription_owner_model @subscription_owner_model.capitalize end |