Class: ActiveAuthentication::OmniauthableGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActiveAuthentication::OmniauthableGenerator
- Defined in:
- lib/generators/active_authentication/omniauthable/omniauthable_generator.rb
Instance Method Summary collapse
Instance Method Details
#generate_model ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/generators/active_authentication/omniauthable/omniauthable_generator.rb', line 6 def generate_model invoke "active_record:model", %w[Authentication uid:string provider:string user:references auth_data:json], skip_collision_check: true if behavior == :invoke inject_into_class "app/models/authentication.rb", "Authentication", " validates :provider, presence: true\n validates :uid, presence: true, uniqueness: {scope: :provider}\n" end end |