Skip to content

Commit

Permalink
6.1z db migration prep
Browse files Browse the repository at this point in the history
  • Loading branch information
lphiri committed Mar 24, 2015
1 parent bfedd4f commit e381220
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module RedhatAccess
module Concerns
module OrganizationExtensions
extend ActiveSupport::Concern
included do
has_one :telemetry_configuration, :class_name => "RedhatAccess::TelemetryConfiguration", :dependent => :destroy
end
end
end
end
12 changes: 12 additions & 0 deletions redhat-access/app/models/redhat_access/telemetry_configuration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module RedhatAccess
class TelemetryConfiguration < ActiveRecord::Base
include Encryptable
belongs_to :organization ,:class_name => "Organization", :inverse_of => :telemetry_configuration
encrypts :portal_password
attr_accessible :enable_telemetry, :portal_password, :portal_user, :organization_id

def name
return "TelemetryConfiguration"
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateRedhatAccessTelemetryConfigurations < ActiveRecord::Migration
def change
create_table :redhat_access_telemetry_configurations do |t|
t.string :portal_user
t.string :portal_password
t.boolean :enable_telemetry
t.integer :organization_id

t.timestamps
end
add_index :redhat_access_telemetry_configurations, :organization_id
end
end
5 changes: 5 additions & 0 deletions redhat-access/lib/redhat_access/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,10 @@ class Engine < ::Rails::Engine
end
end
end

config.to_prepare do

::Organization.send :include, RedhatAccess::Concerns::OrganizationExtensions
end
end
end
2 changes: 1 addition & 1 deletion redhat-access/lib/redhat_access/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RedhatAccess
VERSION = "0.0.9"
VERSION = "0.1.0"
end
5 changes: 4 additions & 1 deletion redhat-access/rubygem-foreman-redhat_access.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%endif

Name: %{?scl_prefix}rubygem-foreman-%{gem_name}
Version: 0.0.9
Version: 0.1.0
Release: 1%{?dist}
Summary: Foreman engine to access Red Hat knowledge base
Group: Development/Languages
Expand Down Expand Up @@ -112,6 +112,9 @@ cp -pa .%{rubygem_redhat_access_dir}/config/config.yml.example %{buildroot}/etc/


%changelog
* Mon Mar 23 2015 Lindani Phiri <[email protected]> - 0.1.0-1
- Database prep for z stream for RHAI (BZ 1197764)

* Wed Mar 4 2015 Lindani Phiri <[email protected]> - 0.0.9-1
- Resolves : bz1197764

Expand Down

0 comments on commit e381220

Please sign in to comment.