Class: Ahoy::Stores::Generators::MongoidVisitsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Ahoy::Stores::Generators::MongoidVisitsGenerator
- Defined in:
- lib/generators/ahoy/stores/mongoid_visits_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_initializer ⇒ Object
21 22 23 |
# File 'lib/generators/ahoy/stores/mongoid_visits_generator.rb', line 21 def create_initializer template "mongoid_initializer.rb", "config/initializers/ahoy.rb" end |
#generate_model ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/generators/ahoy/stores/mongoid_visits_generator.rb', line 9 def generate_model @visitor_id_type = if defined?(::BSON) "BSON::Binary" elsif defined?(::Moped::BSON) "Moped::BSON::Binary" else "String" end template "mongoid_visit_model.rb", "app/models/visit.rb" end |