diff --git a/app/models/article_categorization.rb b/app/models/article_categorization.rb index 46639cb..f86c2eb 100644 --- a/app/models/article_categorization.rb +++ b/app/models/article_categorization.rb @@ -1,5 +1,6 @@ class ArticleCategorization < ActiveRecord::Base - set_table_name :articles_categories + self.table_name = :articles_categories + belongs_to :article belongs_to :category diff --git a/app/models/profile_categorization.rb b/app/models/profile_categorization.rb index 4234fb1..b11472e 100644 --- a/app/models/profile_categorization.rb +++ b/app/models/profile_categorization.rb @@ -1,5 +1,5 @@ class ProfileCategorization < ActiveRecord::Base - set_table_name :categories_profiles + self.table_name = :categories_profiles belongs_to :profile belongs_to :category diff --git a/db/migrate/059_add_birth_date_to_person.rb b/db/migrate/059_add_birth_date_to_person.rb index 79d6a31..a76bee5 100644 --- a/db/migrate/059_add_birth_date_to_person.rb +++ b/db/migrate/059_add_birth_date_to_person.rb @@ -30,7 +30,7 @@ class AddBirthDateToPerson < ActiveRecord::Migration end class Person < ActiveRecord::Base - set_table_name 'profiles' + self.table_name = 'profiles' serialize :data, Hash end diff --git a/db/migrate/069_add_enviroment_id_to_role.rb b/db/migrate/069_add_enviroment_id_to_role.rb index a788f02..9cf8c3b 100644 --- a/db/migrate/069_add_enviroment_id_to_role.rb +++ b/db/migrate/069_add_enviroment_id_to_role.rb @@ -1,6 +1,6 @@ class Role < ActiveRecord::Base; end class RoleWithEnvironment < ActiveRecord::Base - set_table_name 'roles' + self.table_name = 'roles' belongs_to :environment end class RoleAssignment < ActiveRecord::Base diff --git a/plugins/comment_classification/lib/comment_classification_plugin/comment_label_user.rb b/plugins/comment_classification/lib/comment_classification_plugin/comment_label_user.rb index 6a2ce1a..b4c16e5 100644 --- a/plugins/comment_classification/lib/comment_classification_plugin/comment_label_user.rb +++ b/plugins/comment_classification/lib/comment_classification_plugin/comment_label_user.rb @@ -1,5 +1,5 @@ class CommentClassificationPlugin::CommentLabelUser < ActiveRecord::Base - set_table_name :comment_classification_plugin_comment_label_user + self.table_name = :comment_classification_plugin_comment_label_user belongs_to :profile belongs_to :comment diff --git a/plugins/comment_classification/lib/comment_classification_plugin/comment_status_user.rb b/plugins/comment_classification/lib/comment_classification_plugin/comment_status_user.rb index 9ca449a..1437cfb 100644 --- a/plugins/comment_classification/lib/comment_classification_plugin/comment_status_user.rb +++ b/plugins/comment_classification/lib/comment_classification_plugin/comment_status_user.rb @@ -1,5 +1,5 @@ class CommentClassificationPlugin::CommentStatusUser < ActiveRecord::Base - set_table_name :comment_classification_plugin_comment_status_user + self.table_name = :comment_classification_plugin_comment_status_user belongs_to :profile belongs_to :comment diff --git a/plugins/custom_forms/db/migrate/20130823151900_associate_fields_to_alternatives.rb b/plugins/custom_forms/db/migrate/20130823151900_associate_fields_to_alternatives.rb index 1c3882a..df6a986 100644 --- a/plugins/custom_forms/db/migrate/20130823151900_associate_fields_to_alternatives.rb +++ b/plugins/custom_forms/db/migrate/20130823151900_associate_fields_to_alternatives.rb @@ -1,6 +1,6 @@ class AssociateFieldsToAlternatives < ActiveRecord::Migration class CustomFormsPlugin::Field < ActiveRecord::Base - set_table_name :custom_forms_plugin_fields + self.table_name = :custom_forms_plugin_fields has_many :alternatives, :class_name => 'CustomFormsPlugin::Alternative' serialize :choices, Hash end diff --git a/plugins/custom_forms/lib/custom_forms_plugin/alternative.rb b/plugins/custom_forms/lib/custom_forms_plugin/alternative.rb index e6572fb..7090ac1 100644 --- a/plugins/custom_forms/lib/custom_forms_plugin/alternative.rb +++ b/plugins/custom_forms/lib/custom_forms_plugin/alternative.rb @@ -1,5 +1,5 @@ class CustomFormsPlugin::Alternative < ActiveRecord::Base - set_table_name :custom_forms_plugin_alternatives + self.table_name = :custom_forms_plugin_alternatives validates_presence_of :label diff --git a/plugins/custom_forms/lib/custom_forms_plugin/answer.rb b/plugins/custom_forms/lib/custom_forms_plugin/answer.rb index c7730a9..fd66e3d 100644 --- a/plugins/custom_forms/lib/custom_forms_plugin/answer.rb +++ b/plugins/custom_forms/lib/custom_forms_plugin/answer.rb @@ -1,5 +1,5 @@ class CustomFormsPlugin::Answer < ActiveRecord::Base - set_table_name :custom_forms_plugin_answers + self.table_name = :custom_forms_plugin_answers belongs_to :field, :class_name => 'CustomFormsPlugin::Field' belongs_to :submission, :class_name => 'CustomFormsPlugin::Submission' diff --git a/plugins/custom_forms/lib/custom_forms_plugin/field.rb b/plugins/custom_forms/lib/custom_forms_plugin/field.rb index 911555b..c96070e 100644 --- a/plugins/custom_forms/lib/custom_forms_plugin/field.rb +++ b/plugins/custom_forms/lib/custom_forms_plugin/field.rb @@ -1,5 +1,5 @@ class CustomFormsPlugin::Field < ActiveRecord::Base - set_table_name :custom_forms_plugin_fields + self.table_name = :custom_forms_plugin_fields validates_presence_of :name diff --git a/plugins/custom_forms/lib/custom_forms_plugin/numeric.rb b/plugins/custom_forms/lib/custom_forms_plugin/numeric.rb index abb3ddd..1737f66 100644 --- a/plugins/custom_forms/lib/custom_forms_plugin/numeric.rb +++ b/plugins/custom_forms/lib/custom_forms_plugin/numeric.rb @@ -1,4 +1,4 @@ class CustomFormsPlugin::Numeric < CustomFormsPlugin::Field - set_table_name :custom_forms_plugin_fields + self.table_name = :custom_forms_plugin_fields end diff --git a/plugins/custom_forms/lib/custom_forms_plugin/select_field.rb b/plugins/custom_forms/lib/custom_forms_plugin/select_field.rb index f0b8e9f..d91bbea 100644 --- a/plugins/custom_forms/lib/custom_forms_plugin/select_field.rb +++ b/plugins/custom_forms/lib/custom_forms_plugin/select_field.rb @@ -1,5 +1,5 @@ class CustomFormsPlugin::SelectField < CustomFormsPlugin::Field - set_table_name :custom_forms_plugin_fields + self.table_name = :custom_forms_plugin_fields validates_inclusion_of :select_field_type, :in => %w(radio check_box select multiple_select) validates_length_of :alternatives, :minimum => 1, :message => 'can\'t be empty' end diff --git a/plugins/custom_forms/lib/custom_forms_plugin/text_field.rb b/plugins/custom_forms/lib/custom_forms_plugin/text_field.rb index 9524a81..7f694b9 100644 --- a/plugins/custom_forms/lib/custom_forms_plugin/text_field.rb +++ b/plugins/custom_forms/lib/custom_forms_plugin/text_field.rb @@ -1,3 +1,5 @@ class CustomFormsPlugin::TextField < CustomFormsPlugin::Field - set_table_name :custom_forms_plugin_fields + + self.table_name = :custom_forms_plugin_fields + end diff --git a/plugins/mark_comment_as_read/lib/mark_comment_as_read_plugin/read_comments.rb b/plugins/mark_comment_as_read/lib/mark_comment_as_read_plugin/read_comments.rb index 73dcc29..51651f1 100644 --- a/plugins/mark_comment_as_read/lib/mark_comment_as_read_plugin/read_comments.rb +++ b/plugins/mark_comment_as_read/lib/mark_comment_as_read_plugin/read_comments.rb @@ -1,5 +1,5 @@ class MarkCommentAsReadPlugin::ReadComments < ActiveRecord::Base - set_table_name 'mark_comment_as_read_plugin' + self.table_name = 'mark_comment_as_read_plugin' belongs_to :comment belongs_to :person diff --git a/plugins/stoa/lib/stoa_plugin/usp_user.rb b/plugins/stoa/lib/stoa_plugin/usp_user.rb index a1c93df..4a55602 100644 --- a/plugins/stoa/lib/stoa_plugin/usp_user.rb +++ b/plugins/stoa/lib/stoa_plugin/usp_user.rb @@ -1,7 +1,7 @@ class StoaPlugin::UspUser < ActiveRecord::Base establish_connection(:stoa) - set_table_name('pessoa') + self.table_name = 'pessoa' SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] diff --git a/vendor/ezcrypto/test/active_crypto_test.rb b/vendor/ezcrypto/test/active_crypto_test.rb index ef0f7de..2a7cc13 100644 --- a/vendor/ezcrypto/test/active_crypto_test.rb +++ b/vendor/ezcrypto/test/active_crypto_test.rb @@ -24,7 +24,7 @@ end class Assettrue has_many :caps,:dependent=>:destroy - + def self.create(title,email) asset=Asset.new asset.set_session_key(EzCrypto::Key.generate) @@ -39,17 +39,17 @@ class Assettrue - + def self.find_by_key(cap_key) cap_key.chop hash=Digest::SHA1.hexdigest(cap_key) @@ -64,7 +64,7 @@ class Cap < ActiveRecord::Base nil end end - + def self.create_for_asset(asset,email=nil) cap=Cap.new cap.email=email if email @@ -80,28 +80,28 @@ class Cap < ActiveRecord::Base nil end end - + end class Group < ActiveRecord::Base belongs_to :user has_many :group_secrets - + encrypt :name,:group_key, :key=>:user , :base64=>true end class GroupSecret < ActiveRecord::Base belongs_to :group - + encrypt :title,:body, :key=>:group, :base64=>true - + end class ActiveCryptoTest < Test::Unit::TestCase - + def setup end - + def test_key_holder_in_record user=User.new user.name="bob" @@ -112,9 +112,9 @@ class ActiveCryptoTest < Test::Unit::TestCase assert_nil user.session_key user.enter_password "shhcccc" assert_not_nil user.session_key - assert_not_nil user.session_key.encrypt("test") + assert_not_nil user.session_key.encrypt("test") end - + def test_encrypted_child user=User.new user.save @@ -124,22 +124,22 @@ class ActiveCryptoTest < Test::Unit::TestCase assert user.kind_of?(ActiveCrypto::KeyHolder) assert user.kind_of?(ActiveRecord::Base) assert user.kind_of?(User) - + jill=user.secrets.create - + assert_not_nil jill assert jill.kind_of?(ActiveCrypto::AssociationKeyHolder) assert jill.kind_of?(ActiveCrypto::KeyHolder) assert jill.kind_of?(ActiveCrypto::Encrypted) assert jill.kind_of?(ActiveRecord::Base) assert jill.kind_of?(Secret) - + assert jill.respond_to?(:session_key) - + assert_not_nil jill.user assert_not_nil jill.user.session_key - - + + assert_not_nil jill.session_key assert_equal user.session_key,jill.session_key @@ -148,12 +148,12 @@ class ActiveCryptoTest < Test::Unit::TestCase assert_equal "jill",jill.name - + jill=user.secrets.first assert_not_nil jill.session_key assert_equal user.session_key,jill.session_key assert_equal "jill",jill.name - + child=jill.children.create child.email="pelle@neubia.com" child.save @@ -186,20 +186,20 @@ class ActiveCryptoTest < Test::Unit::TestCase cap=Cap.find_by_key key assert_not_nil cap assert_not_nil cap.asset - + assert_equal "title",cap.asset.title assert_equal "title",cap.asset["title"] assert_equal "pelle@neubia.com",cap.email assert_equal "pelle@neubia.com",cap["email"] - + # Non decrypting version raw=AssetRaw.find cap.asset.id assert_not_equal "title",raw.title assert_not_equal "title",raw["title"] - + bob_key=cap.asset.share("bob@bob.com") bob_cap=Cap.find_by_key bob_key - + assert_not_equal key,bob_key assert_not_nil bob_cap assert_not_nil bob_cap.asset diff --git a/vendor/ezcrypto/test/encrypt_test.rb b/vendor/ezcrypto/test/encrypt_test.rb index 16b531b..26b7f38 100644 --- a/vendor/ezcrypto/test/encrypt_test.rb +++ b/vendor/ezcrypto/test/encrypt_test.rb @@ -1,41 +1,41 @@ require 'association_key_holder_test' class EncUser < ActiveRecord::Base - set_table_name "users" + self.table_name = "users" encrypt :name, :base64=>true end class RawUser < ActiveRecord::Base - set_table_name "users" + self.table_name = "users" end class EncryptTest < AssociationKeyHolderTest def setup - @key_holder=EncUser.create + @key_holder=EncUser.create end - + def test_should_be_base64 assert EncUser.ezcrypto_base64? end - + def test_should_retain_session_key_on_reload key=EzCrypto::Key.generate key_holder.set_session_key key assert_not_nil key_holder.session_key assert_equal key.raw,key_holder.session_key.raw - + key_holder.name="bob" key_holder.save - + assert_equal "bob",key_holder.name - + found=EncUser.find key_holder.id assert_equal key_holder.name,found.name - + raw=RawUser.find key_holder.id assert_not_nil raw.name assert_not_equal key_holder.name,raw.name - + end - + end diff --git a/vendor/plugins/access_control/test/test_helper.rb b/vendor/plugins/access_control/test/test_helper.rb index 08ba036..8008f05 100644 --- a/vendor/plugins/access_control/test/test_helper.rb +++ b/vendor/plugins/access_control/test/test_helper.rb @@ -1,6 +1,6 @@ ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") - + require 'test/unit' require 'mocha' @@ -11,12 +11,12 @@ require 'rails/test_help' ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log") load(File.dirname(__FILE__) + '/schema.rb') # change the table names for the tests to not touch -Role.set_table_name 'access_control_test_roles' -RoleAssignment.set_table_name 'access_control_test_role_assignments' +Role.table_name = 'access_control_test_roles' +RoleAssignment.table_name = 'access_control_test_role_assignments' # accessor example class to access some resources class AccessControlTestAccessor < ActiveRecord::Base - set_table_name 'access_control_test_accessors' + self.table_name = 'access_control_test_accessors' acts_as_accessor attr_accessible :name def cache_keys(arg) @@ -29,8 +29,8 @@ end # resource example class to be accessed by some accessor class AccessControlTestResource < ActiveRecord::Base - set_table_name 'access_control_test_resources' - acts_as_accessible + self.table_name = 'access_control_test_resources' + acts_as_accessible PERMISSIONS[self.class.name] = {'bla' => N_('Bla')} attr_accessible :name diff --git a/vendor/plugins/action_tracker/test/action_tracker_model_test.rb b/vendor/plugins/action_tracker/test/action_tracker_model_test.rb index 7fbd0fe..8199ba9 100644 --- a/vendor/plugins/action_tracker/test/action_tracker_model_test.rb +++ b/vendor/plugins/action_tracker/test/action_tracker_model_test.rb @@ -19,7 +19,7 @@ ActiveRecord::Schema.define do end class SomeModel < ActiveRecord::Base - set_table_name :some_table + self.table_name = :some_table acts_as_trackable end @@ -37,7 +37,7 @@ class ActionTrackerModelTest < ActiveSupport::TestCase end def test_params_is_a_hash - assert_kind_of Hash, @tracked_action.params + assert_kind_of Hash, @tracked_action.params end def test_has_a_polymorphic_relation_with_user @@ -57,7 +57,7 @@ class ActionTrackerModelTest < ActiveSupport::TestCase ta = ActionTracker::Record.create! :user => SomeModel.create!, :verb => :some_verb assert_equal "some_verb", ta.verb end - + def test_verb_is_mandatory ta = ActionTracker::Record.new ta.valid? diff --git a/vendor/plugins/action_tracker/test/action_tracker_test.rb b/vendor/plugins/action_tracker/test/action_tracker_test.rb index 084bb85..da8fcde 100644 --- a/vendor/plugins/action_tracker/test/action_tracker_test.rb +++ b/vendor/plugins/action_tracker/test/action_tracker_test.rb @@ -23,12 +23,12 @@ ActiveRecord::Schema.define do end class SomeModel < ActiveRecord::Base - set_table_name :some_table + self.table_name = :some_table acts_as_trackable end class OtherModel < ActiveRecord::Base - set_table_name :other_table + self.table_name = :other_table acts_as_trackable end @@ -108,7 +108,7 @@ class ActionTrackerTest < ActiveSupport::TestCase end def test_track_actions_executes_block - @controller = create_controller do + @controller = create_controller do track_actions :some_verb do throw :some_symbol end @@ -162,7 +162,7 @@ class ActionTrackerTest < ActiveSupport::TestCase assert_difference 'ActionTracker::Record.count' do get :index, :foo => 5 end - assert_equal({"action"=>"index", "foo"=>"5", "controller"=>"things"}, ActionTracker::Record.first.params) + assert_equal({"action"=>"index", "foo"=>"5", "controller"=>"things"}, ActionTracker::Record.first.params) end def test_keep_params_not_set_should_store_all_params @@ -237,7 +237,7 @@ class ActionTrackerTest < ActiveSupport::TestCase end assert_equal "test", ActionTracker::Record.last.user.some_column end - + def test_should_update_when_verb_is_updatable_and_no_timeout ActionTrackerConfig.verbs = { :some_verb => { :description => "Did something", :type => :updatable } } ActionTrackerConfig.timeout = 5.minutes @@ -252,7 +252,7 @@ class ActionTrackerTest < ActiveSupport::TestCase assert_no_difference 'ActionTracker::Record.count' do get :test end - end + end def test_should_create_when_verb_is_updatable_and_timeout ActionTrackerConfig.verbs = { :some_verb => { :description => "Did something", :type => :updatable } } @@ -268,7 +268,7 @@ class ActionTrackerTest < ActiveSupport::TestCase assert_difference 'ActionTracker::Record.count' do get :test end - end + end def test_should_update_when_verb_is_groupable_and_no_timeout ActionTrackerConfig.verbs = { :some_verb => { :description => "Did something", :type => :groupable } } @@ -284,7 +284,7 @@ class ActionTrackerTest < ActiveSupport::TestCase assert_no_difference 'ActionTracker::Record.count' do get :test, :foo => "test" end - end + end def test_should_create_when_verb_is_groupable_and_timeout ActionTrackerConfig.verbs = { :some_verb => { :description => "Did something", :type => :groupable } } @@ -330,7 +330,7 @@ class ActionTrackerTest < ActiveSupport::TestCase def test_should_get_time_spent_doing_something ActionTrackerConfig.verbs = { :some_verb => { :type => :updatable }, :other_verb => { :type => :updatable } } m = SomeModel.create! - @controller = create_controller do + @controller = create_controller do track_actions :some_verb end @controller.stubs(:current_user).returns(m) @@ -394,7 +394,7 @@ class ActionTrackerTest < ActiveSupport::TestCase assert_equal "foo", ActionTracker::Record.last.params["other_column"] assert_nil ActionTracker::Record.last.params["another_column"] end - + def test_replace_dots_by_underline_in_param_name ActionTrackerConfig.verbs = { :test => { :description => "Some" } } model = create_model do @@ -407,7 +407,7 @@ class ActionTrackerTest < ActiveSupport::TestCase assert_equal 3, ActionTracker::Record.last.params["other_column_size"] assert_equal 5, ActionTracker::Record.last.params["another_column"] end - + def test_track_actions_store_all_params ActionTrackerConfig.verbs = { :test => { :description => "Some" } } model = create_model do @@ -452,7 +452,7 @@ class ActionTrackerTest < ActiveSupport::TestCase model = create_model { track_actions :test, :after_create, :keep_params => :all, :if => Proc.new { 2 > 1 } } @controller = create_controller_for_model(model) assert_difference('ActionTracker::Record.count') { get :test } - + model = create_model { track_actions :test, :after_create, :keep_params => :all, :if => Proc.new { 2 < 1 } } @controller = create_controller_for_model(model) assert_no_difference('ActionTracker::Record.count') { get :test } @@ -460,7 +460,7 @@ class ActionTrackerTest < ActiveSupport::TestCase model = create_model { track_actions :test, :after_create, :keep_params => :all, :unless => Proc.new { 2 > 1 } } @controller = create_controller_for_model(model) assert_no_difference('ActionTracker::Record.count') { get :test } - + model = create_model { track_actions :test, :after_create, :keep_params => :all, :unless => Proc.new { 2 < 1 } } @controller = create_controller_for_model(model) assert_difference('ActionTracker::Record.count') { get :test } diff --git a/vendor/plugins/validates_as_cnpj/test/cnpj_test.rb b/vendor/plugins/validates_as_cnpj/test/cnpj_test.rb index 8717bc8..530f805 100755 --- a/vendor/plugins/validates_as_cnpj/test/cnpj_test.rb +++ b/vendor/plugins/validates_as_cnpj/test/cnpj_test.rb @@ -4,7 +4,7 @@ require '../lib/validates_as_cnpj' # Modelo class CNPJData < ActiveRecord::Base - set_table_name "cnpjs" + self.table_name = "cnpjs" validates_as_cnpj :cnpj end @@ -16,37 +16,37 @@ class CNPJsTest < Test::Unit::TestCase assert cnpj_valido.save, "Nao salvou CNPJ nulo." end - + def test_aceita_cnpj_vazio_por_que_deve_ser_barrado_por_validates_presence_of cnpj_valido = CNPJData.new(:id => 1, :cnpj => "") assert cnpj_valido.save, "Nao salvou CNPJ vazio." end - + def test_cnpj_incompleto cnpj_invalido = CNPJData.new(:id => 1, :cnpj => "123") assert ( not cnpj_invalido.save ), "Salvou CNPJ incompleto." end - + def test_cnpj_invalido_sem_pontuacao cnpj_invalido = CNPJData.new(:id => 1, :cnpj => "00000000000000") assert ( not cnpj_invalido.save ), "Salvou CNPJ invalido." end - + def test_cnpj_valido_sem_pontuacao cnpj_valido = CNPJData.new(:id => 1, :cnpj => "04613251000100") assert cnpj_valido.save, "Nao salvou CNPJ valido." end - + def test_cnpj_invalido_sem_pontuacao_com_digitos_verificadores_invertidos cnpj_invalido = CNPJData.new(:id => 1, :cnpj => "10002574000125") assert ( not cnpj_invalido.save ), "Salvou CNPJ invalido." end - + def test_cnpj_invalido_com_pontuacao cnpj_invalido = CNPJData.new(:id => 1, :cnpj => "51.357.999/1110-98") -- libgit2 0.21.2