Sha256: 98424717f2073ec76e97a584aaa98d78b6cf1deebe020c7b701fdbbf1acfafc2

Contents?: true

Size: 351 Bytes

Versions: 16

Compression:

Stored size: 351 Bytes

Contents

class UserGroup < ActiveRecord::Base
  has_and_belongs_to_many :permissions
  has_and_belongs_to_many :users

  validates_presence_of :name
  
	def all_users
		User.find_by_sql <<-SQL
			select users.* 
			from users, user_groups_users
			where users.id = user_groups_users.user_id 
			and user_groups_users.user_group_id = #{self.id}
			SQL
	end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lockdown-0.3.10 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.1 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.11 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.12 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.13 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.14 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.5 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.7 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.8 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.15 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.2 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.6 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.9 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.4.0 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.3 rails_generators/lockdown_all/templates/app/models/user_group.rb
lockdown-0.3.4 rails_generators/lockdown_all/templates/app/models/user_group.rb