Browse Source

audit and deps upgrade

pull/1/head
Claudius Nicolae 12 years ago
parent
commit
31aac8afbe
  1. 18
      Gemfile
  2. 165
      Gemfile.lock
  3. 5
      app/models/audit.rb
  4. 1
      app/models/domain.rb
  5. 1
      app/models/permission.rb
  6. 1
      app/models/record.rb
  7. 1
      app/models/user.rb
  8. 1
      config/initializers/audited.rb
  9. 15
      config/initializers/rails_admin.rb
  10. 2
      db/seeds/development/domains.seeds.rb

18
Gemfile

@ -1,6 +1,6 @@
source 'http://rubygems.org' source 'http://rubygems.org'
gem 'rails', '3.2.11' gem 'rails', '3.2.12'
# Bundle edge Rails instead: # Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git' # gem 'rails', :git => 'git://github.com/rails/rails.git'
@ -30,10 +30,8 @@ gem 'rails-backbone', '~> 0.7.0'
gem 'acts_as_nested_interval', '~> 0.0.7' gem 'acts_as_nested_interval', '~> 0.0.7'
# path: '/home/clyfe/dev/acts_as_nested_interval' # path: '/home/clyfe/dev/acts_as_nested_interval'
# git: 'https://github.com/clyfe/acts_as_nested_interval.git' # git: 'https://github.com/clyfe/acts_as_nested_interval.git'
gem 'webshims-rails', '~> 0.2'
gem 'font-awesome-sass-rails', '~> 2.0.0.0'
gem 'seedbank', '~> 0.1.3' gem 'seedbank', '~> 0.1.3'
gem 'rails_admin', '~> 0.0.5' gem 'rails_admin', '~> 0.4.5'
gem 'rails-settings-cached', '~> 0.2.2' gem 'rails-settings-cached', '~> 0.2.2'
gem 'unicorn', '~> 4.5.0' gem 'unicorn', '~> 4.5.0'
gem "audited-activerecord", '~> 3.0' gem "audited-activerecord", '~> 3.0'
@ -43,18 +41,20 @@ gem "audited-activerecord", '~> 3.0'
group :assets do group :assets do
gem 'sass-rails', " ~> 3.2.3" gem 'sass-rails', " ~> 3.2.3"
gem 'compass-rails', '~> 1.0.3' gem 'compass-rails', '~> 1.0.3'
gem 'bootstrap-sass', '~> 2.1.0.0' gem 'bootstrap-sass', '~> 2.2.0'
gem 'font-awesome-sass-rails', '~> 3.0.0'
gem 'webshims-rails', '~> 0.4.7'
gem 'coffee-rails', "~> 3.2.1" gem 'coffee-rails', "~> 3.2.1"
gem 'uglifier', '>= 1.0.3' gem 'uglifier', '>= 1.0.3'
gem 'therubyracer' gem 'therubyracer'
end end
gem 'jquery-rails' gem 'jquery-rails', '~> 2.1.3'
gem 'dalli', '~> 1.1.3' gem 'dalli', '~> 2.6.2'
gem 'active_scaffold', '~> 3.2.16' gem 'active_scaffold', '~> 3.2.19'
# git: 'https://github.com/activescaffold/active_scaffold.git' # git: 'https://github.com/activescaffold/active_scaffold.git'
# path: '/home/clyfe/dev/active_scaffold' # path: '/home/clyfe/dev/active_scaffold'
gem 'turbolinks', '~> 0.5.1' gem 'turbolinks', '~> 1.0.0'
# gem 'foreigner' ? # gem 'foreigner' ?
group :development do group :development do

165
Gemfile.lock

@ -21,16 +21,16 @@ GIT
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
actionmailer (3.2.11) actionmailer (3.2.12)
actionpack (= 3.2.11) actionpack (= 3.2.12)
mail (~> 2.4.4) mail (~> 2.4.4)
actionpack (3.2.11) actionpack (3.2.12)
activemodel (= 3.2.11) activemodel (= 3.2.12)
activesupport (= 3.2.11) activesupport (= 3.2.12)
builder (~> 3.0.0) builder (~> 3.0.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
journey (~> 1.0.4) journey (~> 1.0.4)
rack (~> 1.4.0) rack (~> 1.4.5)
rack-cache (~> 1.2) rack-cache (~> 1.2)
rack-test (~> 0.6.1) rack-test (~> 0.6.1)
sprockets (~> 2.2.1) sprockets (~> 2.2.1)
@ -39,18 +39,18 @@ GEM
mail mail
active_scaffold (3.2.19) active_scaffold (3.2.19)
rails (>= 3.1.3) rails (>= 3.1.3)
activemodel (3.2.11) activemodel (3.2.12)
activesupport (= 3.2.11) activesupport (= 3.2.12)
builder (~> 3.0.0) builder (~> 3.0.0)
activerecord (3.2.11) activerecord (3.2.12)
activemodel (= 3.2.11) activemodel (= 3.2.12)
activesupport (= 3.2.11) activesupport (= 3.2.12)
arel (~> 3.0.2) arel (~> 3.0.2)
tzinfo (~> 0.3.29) tzinfo (~> 0.3.29)
activeresource (3.2.11) activeresource (3.2.12)
activemodel (= 3.2.11) activemodel (= 3.2.12)
activesupport (= 3.2.11) activesupport (= 3.2.12)
activesupport (3.2.11) activesupport (3.2.12)
i18n (~> 0.6) i18n (~> 0.6)
multi_json (~> 1.0) multi_json (~> 1.0)
acts_as_nested_interval (0.0.10) acts_as_nested_interval (0.0.10)
@ -60,9 +60,9 @@ GEM
audited-activerecord (3.0.0) audited-activerecord (3.0.0)
activerecord (~> 3.0) activerecord (~> 3.0)
audited (= 3.0.0) audited (= 3.0.0)
bbenezech-nested_form (0.0.6)
bcrypt-ruby (3.0.1) bcrypt-ruby (3.0.1)
bootstrap-sass (2.1.0.1) bootstrap-sass (2.2.2.0)
sass (~> 3.2)
builder (3.0.4) builder (3.0.4)
cancan (1.6.7) cancan (1.6.7)
capistrano (2.9.0) capistrano (2.9.0)
@ -80,17 +80,17 @@ GEM
rack-test (>= 0.5.4) rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0) selenium-webdriver (~> 2.0)
xpath (~> 0.1.4) xpath (~> 0.1.4)
childprocess (0.3.7) childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.6) ffi (~> 1.0, >= 1.0.11)
chunky_png (1.2.7) chunky_png (1.2.7)
coderay (1.0.8) coderay (1.0.9)
coffee-rails (3.2.2) coffee-rails (3.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (~> 3.2.0) railties (~> 3.2.0)
coffee-script (2.2.0) coffee-script (2.2.0)
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.4.0) coffee-script-source (1.6.1)
compass (0.12.2) compass (0.12.2)
chunky_png (~> 1.2) chunky_png (~> 1.2)
fssm (>= 0.2.7) fssm (>= 0.2.7)
@ -99,7 +99,7 @@ GEM
compass (>= 0.12.2, < 0.14) compass (>= 0.12.2, < 0.14)
concerned_with (0.1.0) concerned_with (0.1.0)
daemons (1.0.10) daemons (1.0.10)
dalli (1.1.5) dalli (2.6.2)
database_cleaner (0.7.2) database_cleaner (0.7.2)
devise (2.1.3) devise (2.1.3)
bcrypt-ruby (~> 3.0) bcrypt-ruby (~> 3.0)
@ -121,7 +121,7 @@ GEM
ffi (1.0.11) ffi (1.0.11)
file-tail (1.0.12) file-tail (1.0.12)
tins (~> 0.5) tins (~> 0.5)
font-awesome-sass-rails (2.0.0.0) font-awesome-sass-rails (3.0.2.2)
railties (>= 3.1.1) railties (>= 3.1.1)
sass-rails (>= 3.1.1) sass-rails (>= 3.1.1)
fssm (0.2.10) fssm (0.2.10)
@ -137,18 +137,19 @@ GEM
guard-spork (0.5.2) guard-spork (0.5.2)
guard (>= 0.10.0) guard (>= 0.10.0)
spork (>= 0.8.4) spork (>= 0.8.4)
haml (3.1.7) haml (4.0.0)
tilt
highline (1.6.15) highline (1.6.15)
hike (1.2.1) hike (1.2.1)
i18n (0.6.1) i18n (0.6.4)
journey (1.0.4) journey (1.0.4)
jquery-rails (2.2.0) jquery-rails (2.1.4)
railties (>= 3.0, < 5.0) railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
jquery-ui-rails (1.1.1) jquery-ui-rails (3.0.1)
jquery-rails jquery-rails
railties (>= 3.1.0) railties (>= 3.1.0)
json (1.7.6) json (1.7.7)
kaminari (0.14.1) kaminari (0.14.1)
actionpack (>= 3.0.0) actionpack (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
@ -156,7 +157,7 @@ GEM
libnotify (0.7.4) libnotify (0.7.4)
ffi (~> 1.0.11) ffi (~> 1.0.11)
libv8 (3.11.8.13) libv8 (3.11.8.13)
listen (0.7.2) listen (0.7.3)
lumberjack (1.0.2) lumberjack (1.0.2)
mail (2.4.4) mail (2.4.4)
i18n (>= 0.4.0) i18n (>= 0.4.0)
@ -164,19 +165,20 @@ GEM
treetop (~> 1.4.8) treetop (~> 1.4.8)
mail_form (1.3.0) mail_form (1.3.0)
method_source (0.8.1) method_source (0.8.1)
mime-types (1.20.1) mime-types (1.21)
mongrel (1.2.0.pre2) mongrel (1.2.0.pre2)
daemons (~> 1.0.10) daemons (~> 1.0.10)
gem_plugin (~> 0.2.3) gem_plugin (~> 0.2.3)
multi_json (1.5.0) multi_json (1.6.1)
mysql2 (0.3.11) mysql2 (0.3.11)
net-scp (1.0.4) nested_form (0.3.1)
net-ssh (>= 1.99.1) net-scp (1.1.0)
net-sftp (2.0.5) net-ssh (>= 2.6.5)
net-ssh (>= 2.0.9) net-sftp (2.1.1)
net-ssh (2.6.3) net-ssh (>= 2.6.5)
net-ssh-gateway (1.1.0) net-ssh (2.6.6)
net-ssh (>= 1.99.1) net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
nilify_blanks (1.0.0) nilify_blanks (1.0.0)
activerecord (>= 3.0.0) activerecord (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
@ -185,13 +187,13 @@ GEM
polyamorous (0.5.0) polyamorous (0.5.0)
activerecord (~> 3.0) activerecord (~> 3.0)
polyglot (0.3.3) polyglot (0.3.3)
pry (0.9.11.4) pry (0.9.12)
coderay (~> 1.0.5) coderay (~> 1.0.5)
method_source (~> 0.8) method_source (~> 0.8)
slop (~> 3.4) slop (~> 3.4)
quiet_assets (1.0.1) quiet_assets (1.0.2)
railties (~> 3.1) railties (>= 3.1, < 5.0)
rack (1.4.4) rack (1.4.5)
rack-cache (1.2) rack-cache (1.2)
rack (>= 0.4) rack (>= 0.4)
rack-pjax (0.7.0) rack-pjax (0.7.0)
@ -201,38 +203,40 @@ GEM
rack rack
rack-test (0.6.2) rack-test (0.6.2)
rack (>= 1.0) rack (>= 1.0)
rails (3.2.11) rails (3.2.12)
actionmailer (= 3.2.11) actionmailer (= 3.2.12)
actionpack (= 3.2.11) actionpack (= 3.2.12)
activerecord (= 3.2.11) activerecord (= 3.2.12)
activeresource (= 3.2.11) activeresource (= 3.2.12)
activesupport (= 3.2.11) activesupport (= 3.2.12)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.2.11) railties (= 3.2.12)
rails-backbone (0.7.2) rails-backbone (0.7.2)
coffee-script (~> 2.2.0) coffee-script (~> 2.2.0)
ejs (~> 1.0.0) ejs (~> 1.0.0)
railties (>= 3.1.0) railties (>= 3.1.0)
rails-settings-cached (0.2.4) rails-settings-cached (0.2.4)
rails (>= 3.0.0) rails (>= 3.0.0)
rails_admin (0.0.5) rails_admin (0.4.5)
bbenezech-nested_form (~> 0.0.6) bootstrap-sass (~> 2.2)
bootstrap-sass (~> 2.0, >= 2.0.3)
builder (~> 3.0) builder (~> 3.0)
coffee-rails (~> 3.1) coffee-rails (~> 3.1)
haml (~> 3.1) font-awesome-sass-rails (~> 3.0, >= 3.0.0.1)
jquery-rails (>= 1.0.17) haml (~> 4.0)
jquery-ui-rails (>= 0.5, < 2) jquery-rails (~> 2.1)
kaminari (~> 0.12) jquery-ui-rails (~> 3.0)
rack-pjax (~> 0.5) kaminari (~> 0.14)
nested_form (~> 0.3)
rack-pjax (~> 0.6)
rails (~> 3.1) rails (~> 3.1)
remotipart (~> 1.0) remotipart (~> 1.0)
safe_yaml (~> 0.6)
sass-rails (~> 3.1) sass-rails (~> 3.1)
rails_config (0.2.7) rails_config (0.2.7)
activesupport (>= 3.0) activesupport (>= 3.0)
railties (3.2.11) railties (3.2.12)
actionpack (= 3.2.11) actionpack (= 3.2.12)
activesupport (= 3.2.11) activesupport (= 3.2.12)
rack-ssl (~> 1.3.2) rack-ssl (~> 1.3.2)
rake (>= 0.8.7) rake (>= 0.8.7)
rdoc (~> 3.4) rdoc (~> 3.4)
@ -241,10 +245,10 @@ GEM
rake (10.0.3) rake (10.0.3)
rb-inotify (0.8.8) rb-inotify (0.8.8)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rdoc (3.12) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
ref (1.0.2) ref (1.0.2)
remotipart (1.0.2) remotipart (1.0.5)
rspec (2.10.0) rspec (2.10.0)
rspec-core (~> 2.10.0) rspec-core (~> 2.10.0)
rspec-expectations (~> 2.10.0) rspec-expectations (~> 2.10.0)
@ -264,13 +268,14 @@ GEM
ruby_parser (2.3.1) ruby_parser (2.3.1)
sexp_processor (~> 3.0) sexp_processor (~> 3.0)
rubyzip (0.9.9) rubyzip (0.9.9)
sass (3.2.5) safe_yaml (0.8.4)
sass (3.2.6)
sass-rails (3.2.6) sass-rails (3.2.6)
railties (~> 3.2.0) railties (~> 3.2.0)
sass (>= 3.1.10) sass (>= 3.1.10)
tilt (~> 1.3) tilt (~> 1.3)
seedbank (0.1.3) seedbank (0.1.3)
selenium-webdriver (2.29.0) selenium-webdriver (2.31.0)
childprocess (>= 0.2.5) childprocess (>= 0.2.5)
multi_json (~> 1.0) multi_json (~> 1.0)
rubyzip rubyzip
@ -297,24 +302,24 @@ GEM
multi_json (~> 1.0) multi_json (~> 1.0)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
squeel (1.0.15) squeel (1.0.17)
activerecord (~> 3.0) activerecord (~> 3.0)
activesupport (~> 3.0) activesupport (~> 3.0)
polyamorous (~> 0.5.0) polyamorous (~> 0.5.0)
switch_user (0.6.0) switch_user (0.6.0)
terminal-table (1.4.5) terminal-table (1.4.5)
therubyracer (0.11.3) therubyracer (0.11.4)
libv8 (~> 3.11.8.12) libv8 (~> 3.11.8.12)
ref ref
thor (0.17.0) thor (0.17.0)
tilt (1.3.3) tilt (1.3.4)
tins (0.7.0) tins (0.7.1)
treetop (1.4.12) treetop (1.4.12)
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
turbolinks (0.5.2) turbolinks (1.0.0)
coffee-rails coffee-rails
tzinfo (0.3.35) tzinfo (0.3.36)
uglifier (1.3.0) uglifier (1.3.0)
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2) multi_json (~> 1.0, >= 1.0.2)
@ -324,7 +329,7 @@ GEM
raindrops (~> 0.7) raindrops (~> 0.7)
warden (1.2.1) warden (1.2.1)
rack (>= 1.0) rack (>= 1.0)
webshims-rails (0.4.6) webshims-rails (0.4.7)
rails (> 3.1.0) rails (> 3.1.0)
websocket (1.0.7) websocket (1.0.7)
xpath (0.1.4) xpath (0.1.4)
@ -335,10 +340,10 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
active-model-email-validator (~> 1.0.2) active-model-email-validator (~> 1.0.2)
active_scaffold (~> 3.2.16) active_scaffold (~> 3.2.19)
acts_as_nested_interval (~> 0.0.7) acts_as_nested_interval (~> 0.0.7)
audited-activerecord (~> 3.0) audited-activerecord (~> 3.0)
bootstrap-sass (~> 2.1.0.0) bootstrap-sass (~> 2.2.0)
cancan (= 1.6.7) cancan (= 1.6.7)
capistrano (~> 2.9.0) capistrano (~> 2.9.0)
capistrano-ext (~> 1.2.1) capistrano-ext (~> 1.2.1)
@ -346,15 +351,15 @@ DEPENDENCIES
coffee-rails (~> 3.2.1) coffee-rails (~> 3.2.1)
compass-rails (~> 1.0.3) compass-rails (~> 1.0.3)
concerned_with (~> 0.1.0) concerned_with (~> 0.1.0)
dalli (~> 1.1.3) dalli (~> 2.6.2)
database_cleaner (~> 0.7.1) database_cleaner (~> 0.7.1)
devise (~> 2.1.0) devise (~> 2.1.0)
factory_girl_rails (~> 1.6.0) factory_girl_rails (~> 1.6.0)
faker (~> 1.0.1) faker (~> 1.0.1)
font-awesome-sass-rails (~> 2.0.0.0) font-awesome-sass-rails (~> 3.0.0)
guard-rspec (~> 0.6.0) guard-rspec (~> 0.6.0)
guard-spork (~> 0.5.1) guard-spork (~> 0.5.1)
jquery-rails jquery-rails (~> 2.1.3)
libnotify (~> 0.7.2) libnotify (~> 0.7.2)
mail_form (~> 1.3.0) mail_form (~> 1.3.0)
mongrel (>= 1.2.0.pre2) mongrel (>= 1.2.0.pre2)
@ -362,10 +367,10 @@ DEPENDENCIES
navigasmic (~> 0.5.6)! navigasmic (~> 0.5.6)!
nilify_blanks (~> 1.0.0) nilify_blanks (~> 1.0.0)
quiet_assets (~> 1.0.1) quiet_assets (~> 1.0.1)
rails (= 3.2.11) rails (= 3.2.12)
rails-backbone (~> 0.7.0) rails-backbone (~> 0.7.0)
rails-settings-cached (~> 0.2.2) rails-settings-cached (~> 0.2.2)
rails_admin (~> 0.0.5) rails_admin (~> 0.4.5)
rails_config (~> 0.2.4) rails_config (~> 0.2.4)
rb-inotify (~> 0.8.8) rb-inotify (~> 0.8.8)
rspec-rails (~> 2.10.1) rspec-rails (~> 2.10.1)
@ -379,9 +384,9 @@ DEPENDENCIES
squeel (~> 1.0.0) squeel (~> 1.0.0)
switch_user (~> 0.6.0) switch_user (~> 0.6.0)
therubyracer therubyracer
turbolinks (~> 0.5.1) turbolinks (~> 1.0.0)
uglifier (>= 1.0.3) uglifier (>= 1.0.3)
unicorn (~> 4.5.0) unicorn (~> 4.5.0)
userstamp (~> 2.0.2)! userstamp (~> 2.0.2)!
validates_hostname (~> 1.0.0)! validates_hostname (~> 1.0.0)!
webshims-rails (~> 0.2) webshims-rails (~> 0.4.7)

5
app/models/audit.rb

@ -0,0 +1,5 @@
class Audit < Audited::Adapters::ActiveRecord::Audit
before_save do
self.username = user.full_name if !username && user
end
end

1
app/models/domain.rb

@ -14,6 +14,7 @@ class Domain < ActiveRecord::Base
has_many :records, :inverse_of => :domain, :dependent => :destroy has_many :records, :inverse_of => :domain, :dependent => :destroy
has_many :permissions, :inverse_of => :domain, :dependent => :destroy has_many :permissions, :inverse_of => :domain, :dependent => :destroy
has_many :permitted_users, :through => :permissions, :source => :user has_many :permitted_users, :through => :permissions, :source => :user
has_many :audits, :as => :auditable
cattr_reader :types cattr_reader :types
@@types = ['NATIVE', 'MASTER', 'SLAVE', 'SUPERSLAVE'] @@types = ['NATIVE', 'MASTER', 'SLAVE', 'SUPERSLAVE']

1
app/models/permission.rb

@ -4,6 +4,7 @@ class Permission < ActiveRecord::Base
belongs_to :domain, :inverse_of => :permissions belongs_to :domain, :inverse_of => :permissions
belongs_to :user, :inverse_of => :permissions belongs_to :user, :inverse_of => :permissions
has_many :audits, :as => :auditable
validates :domain_id, :presence => true validates :domain_id, :presence => true
validates :user_id, :presence => true, :uniqueness => { validates :user_id, :presence => true, :uniqueness => {

1
app/models/record.rb

@ -4,6 +4,7 @@ class Record < ActiveRecord::Base
belongs_to :domain, :inverse_of => :records belongs_to :domain, :inverse_of => :records
belongs_to :user, :inverse_of => :records belongs_to :user, :inverse_of => :records
has_many :audits, :as => :auditable
cattr_reader :types cattr_reader :types
@@types = %w(SOA NS A MX TXT CNAME AAAA SRV) @@types = %w(SOA NS A MX TXT CNAME AAAA SRV)

1
app/models/user.rb

@ -25,6 +25,7 @@ class User < ActiveRecord::Base
has_many :records, :inverse_of => :user, :dependent => :destroy has_many :records, :inverse_of => :user, :dependent => :destroy
has_many :permissions, :inverse_of => :user, :dependent => :destroy has_many :permissions, :inverse_of => :user, :dependent => :destroy
has_many :permitted_domains, :through => :permissions, :source => :domain has_many :permitted_domains, :through => :permissions, :source => :domain
has_many :audits, :as => :auditable
def name def name
full_name.blank? ? email : full_name full_name.blank? ? email : full_name

1
config/initializers/audited.rb

@ -0,0 +1 @@
Audited.audit_class = Audit

15
config/initializers/rails_admin.rb

@ -35,7 +35,7 @@ RailsAdmin.config do |config|
# Add models here if you want to go 'whitelist mode': # Add models here if you want to go 'whitelist mode':
config.included_models = [A, AAAA, Admin, CNAME, Domain, MX, NS, Permission, config.included_models = [A, AAAA, Admin, CNAME, Domain, MX, NS, Permission,
Record, SOA, SRV, TXT, User, Audited::Adapters::ActiveRecord::Audit] Record, SOA, SRV, TXT, User, Audit]
# Application wide tried label methods for models' instances # Application wide tried label methods for models' instances
# config.label_methods << :description # Default is [:name, :title] # config.label_methods << :description # Default is [:name, :title]
@ -84,6 +84,19 @@ RailsAdmin.config do |config|
configure :value, :text configure :value, :text
end end
config.model Audit do
field :id
field :user
field :username
field :auditable
field :action
field :audited_changes
field :version
field :comment
field :remote_address
field :created_at
end
# config.model A do # config.model A do
# # Found associations: # # Found associations:
# configure :domain, :belongs_to_association # configure :domain, :belongs_to_association

2
db/seeds/development/domains.seeds.rb

@ -2,6 +2,7 @@ after 'development:users' do
entrydns_org = Domain.find_by_name(Settings.host_domains.first) entrydns_org = Domain.find_by_name(Settings.host_domains.first)
User.all.each do |user| User.all.each do |user|
Audit.as_user(user) do
3.times do 3.times do
domain = Factory.build(:domain, :user => user) domain = Factory.build(:domain, :user => user)
domain.setup(FactoryGirl.generate(:email)) domain.setup(FactoryGirl.generate(:email))
@ -13,5 +14,6 @@ after 'development:users' do
Factory.create(:a, :user => user, :domain => entrydns_org) Factory.create(:a, :user => user, :domain => entrydns_org)
end end
end end
end
end end

Loading…
Cancel
Save